Repository navigation
Conversation
|
Warning Review limit reachedNext included review available in 53 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: SEMOSAN/SEMOSAN_FE/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Member
Author
|
브랜치 이름을 저장소 컨벤션( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
백엔드 PR의 후속 작업 — 마일스톤당 인증 사진 1장 제약에 대한 프론트 대응입니다.
문제
프론트가 MinIO 업로드 → 메타 POST 순서로 동작해서, 같은 마일스톤을 두 번 찍으면 서버가 409로 거절하는 시점엔 이미 파일이 버킷에 올라가 있습니다. 고아 오브젝트가 남습니다.
기존 가드는 두 개뿐이었습니다.
photosTakenRef >= MAX_TRACKING_PHOTOS)isSavingPhotoRef)둘 다 "같은 마일스톤을 두 번"은 막지 못합니다. 3장 찍은 상태에서 한 지점을 다시 찍으면 그대로 통과합니다.
변경 (
app/(tabs)/tracking.tsx)업로드 전에 끊는 것이 핵심입니다.
capturedMilestonesRef: Set<number>로 이미 사진을 남긴 마일스톤을 들고,handleCameraPress에서 카메라를 열기 전에 검사합니다. 기존photosTakenRef와 동일하게 세 지점(세션 복원 / 촬영 성공 / 세션 정리)에서 갱신해 패턴을 맞췄습니다. 세션을 나갔다 들어와도 서버 사진 목록 기준으로 복원되므로 다시 찍히지 않습니다.촬영 UI 닫기 — 별도 상태 없이
trackingPhotos에서 파생했습니다.PhotoWindowBanner: 해당 마일스톤을 찍었으면 내려갑니다정상(summit) 인증 창은 ref로만 보관돼 렌더에서 읽을 수 없어
summitMilestoneIndex상태 미러를 추가했습니다. 인덱스를 아직 모르는 경우(4/4 창 누락 등)엔 기존대로 열어둬 동작을 바꾸지 않았습니다.409 방어 — 다른 기기나 상태 유실로 409가 실제로 발생하면, 기존엔 "다시 시도해주세요" 토스트가 떠서 누를 때마다 고아 파일이 하나씩 더 쌓였습니다. 이제 409를 잡아 그 마일스톤을 닫고 "이 지점의 인증 사진은 이미 남겼어요"로 안내합니다.
검증
npx tsc --noEmit통과,npm run lint에러 0(경고는 모두 기존 코드),npm test29개 통과.아직 확인 못 한 것
남는 한계
409가 발생한 경우 서버엔 사진이 있는데 레일 썸네일에는 뜨지 않습니다(업로드한 URL과 서버가 보관 중인 URL이 다르므로). 추가 업로드는 막히지만 화면은 어긋난 채로 남습니다. 서버 사진 목록 재조회로 맞출 수 있는데, 이번 범위를 넘는다고 보고 넣지 않았습니다.
버킷에 이미 쌓인 고아 오브젝트 정리는 백엔드 쪽 별도 이슈입니다.
🤖 Generated with Claude Code