-
Notifications
You must be signed in to change notification settings - Fork 1
[REFACTOR] PresignedURL API 로직 수정, PhotoManager 구현 (#272) #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cirtuare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PhotoManager 좋다 !!! 리뷰만 한 번 확인 부탁드립니당 👍💗
| continuation.resume(throwing: PhotoManagerError.tokenExpired) | ||
| case .requestErr(let errorResponse): | ||
| continuation.resume(throwing: errorResponse) | ||
| case .decodedErr, .pathErr, .serverErr, .networkFail, .naverAPIErr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐿️🐿️
그냥 default로 처리해도 좋을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
근데 네트워크와 상관없는 서버 에러도 networkError 타입으로 처리하는 이유가 있나요?!
| } catch { | ||
| handleNetworkError { [weak self] in | ||
| self?.executeUploadFlow() | ||
| } | ||
| print("❌ A failure occurred during the upload process: \(error.localizedDescription)") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐿️🐿️🐿️
이 handleNetworkError가 networkFail 시에만 호출되어야 하는데, 지금 catch에 별다른 타입 지정이 없어 tokenExpired이 아닌 에러의 경우 모두 handleNetworkError가 호출되고 있는 것 같아요
networkFail와 다른 에러들을 구분해주는 게 좋을 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러 핸들링 세분화했습니다! 피드백 감사해용
🐿️ Pull Requests
🪵 작업 브랜치
🥔 작업 내용
PresignedURL API 수정사항 반영
PhotoManager 구현
PhotoManager를 구현하여, presignedURL 처리를 간편하게 하고, 성능을 개선했습니다.
기존
개선
→ViewModel은
await PhotoManager.uploadImages()만 호출 (관심사 분리)🚨 참고 사항
서버 로직 문제로 presignedURL 획득 과정에서 401에러가 나고 있는데,
이때 우리 프로젝트 구조상,
handleReissue로 빠져, 네트워킹을 재시도하는 무한 루프에 빠지게 됩니다.과금 방지를 위해, 최대 1번만 재시도하고, 실패 시 다음에 시도하라는 Alert을 띄워, TabBar로 이동을 유도했습니다. (gif 1 참고)
📸 스크린샷
💥 To be sure
🌰 Resolve issue