Uh oh!
There was an error while loading. Please reload this page.
[Fix] FCM 토큰이 바뀌어도 서버에 반영하지 않는 문제 수정 - #567
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
#️⃣연관된 이슈
Closes#565
📝작업 내용
FCM 토큰이 갱신돼도 다음 앱 진입까지 서버에 올라가지 않던 경로를 끊었습니다. onNewToken()에서 저장한 뒤 WorkManager로 전송을 예약합니다.
FcmTokenSyncWorker 추가
FcmService.onNewToken()은 저장 후 워커만 예약
SyncFcmTokenUseCase 추가
FcmTokenProvider의 메모리 캐시 제거
토큰 없는 POST /login을 실패로 반환
Hilt Worker 설정
테스트
SyncFcmTokenUseCaseTest
FcmTokenSyncPolicyTest
MainViewModelTest
스크린샷 (선택)
💬리뷰 요구사항(선택)
ExistingWorkPolicy를 REPLACE로 뒀습니다. 실행 중인 워커가 있으면 취소되고 새로 시작합니다. 워커가 실행 시점에 최신 토큰을 읽으므로 KEEP도 동작하지만, 백오프 대기가 긴 상태에서 새 토큰이 오면 그대로 기다리게 됩니다. KEEP이 나을지 봐주세요.
재시도 상한을 5회로 뒀습니다. 30초 지수 백오프 기준 마지막 시도까지 약 8분입니다.
워커의 로그인 상태 확인은 회원ID 유무로 판단합니다. clearSession()이 인증 상태와 회원ID를 함께 지우고, MainViewModel의 진입 라우팅도 같은 기준을 씁니다.
이름 정리는 후속 PR로 분리했습니다. AuthRepository.login()을 FcmRepository.registerToken()으로 옮기는 작업입니다.
이번 범위 밖으로 남긴 것이 있습니다. 별도 이슈로 올릴 예정입니다.