Uh oh!
There was an error while loading. Please reload this page.
[Refactor] POST login 호출을 FcmRepository.registerToken으로 이동 - #568
Merged
Conversation
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#566
#565 후속입니다. base 브랜치는 fix/fcm-token-sync-565이므로 그 PR이 머지된 뒤에 봐주세요.
📝작업 내용
POST /login을 부르는 자리의 이름을 용도에 맞게 바꿨습니다. 동작 변경은 없습니다.
서버 AuthController.loginMember()는 회원을 조회한 뒤 X-Fcm-Token 헤더가 있을 때만 fcmTokenCommandService.saveFcmToken()을 부릅니다. AuthServiceImpl.login()은 memberRepository.findByMemberIdAndMemberDeletedAtNull()이 전부입니다. 세션 생성도 최종 로그인 시각 갱신도 없습니다. 클라이언트 입장에서 이 호출의 실질은 기기 토큰 등록입니다.
도메인이 엔드포인트 이름을 들고 있으면 FCM 전용 API가 생길 때 인터페이스까지 흔들립니다. POST /login을 쓴다는 사실을 data 계층에 가둡니다.
MainViewModel의 판정이 BaseResult에서 FcmTokenSyncResult로 바뀝니다. SUCCESS가 아니면 대기를 닫지 않습니다. SKIPPED는 보낼 토큰이 없는 상태라 재연결 때 다시 봅니다.
serverLoginPending을 registrationPending으로 바꿨습니다. 서버 로그인이 아니라 토큰 등록이기 때문입니다.
테스트
스크린샷 (선택)
💬리뷰 요구사항(선택)
registerToken()이라는 이름이 맞는지 봐주세요. registerDevice()도 후보였습니다. 서버가 토큰과 함께 platform, accessMode, User-Agent를 저장하므로 기기 등록에 가깝기도 합니다.
FcmRepositoryImpl.registerToken()에 토큰 선확인이 그대로 남아 있습니다. SyncFcmTokenUseCase도 같은 검사를 하므로 중복이지만, 엔드포인트를 부르는 경계에 두는 편이 안전하다고 봤습니다.