Repository navigation
fix: 로그아웃할 때 이 기기에 남는 알람과 공유 코드를 함께 지운다 (165) - #168
Merged
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 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.
📌 Issues
Closes #165
📎 Work Description
로그아웃해도 그 계정의 알람이 기기에 그대로 남았습니다. 반복 일정이면 매일 영구히 울리고, 목록에 없어 끌 방법이 없습니다.
어제까지는 이 자리가 큰 문제가 아니었습니다. 걸어 둔 알람이 한 번 울리고 끝났고 재부팅하면 사라졌기 때문입니다. 그런데 같은 세션에서 두 가지가 바뀌었습니다.
그래서 지금은 로그아웃한 계정의 반복 알람이 그 기기에서 영구히 울립니다. 부모님 폰에서 자녀 계정으로 시험 삼아 일정을 하나 저장하고 로그아웃하면, 목록에 없는 알람이 매일 뜨고 벗어나는 길은 앱 데이터 삭제뿐입니다.
세션을 끝내는 일을 한 자리로 모았습니다. 로그아웃은 두 곳에서 일어납니다 — 내 정보 화면과, 앱을 지웠다 다시 깐 것을 감지하는
MainActivity입니다. 둘이 각자authRepository.signOut()만 부르고 있었습니다.SignOutUseCase가 셋을 순서대로 합니다.alarmScheduler.cancelAll()— 걸린 알람과 기기 안 장부를 비웁니다.settingsRepository.clearShareCode()— 등록해 둔 가족의 공유 코드를 지웁니다.authRepository.signOut()— 세션을 끊습니다.순서가 중요합니다. 세션을 먼저 끊으면 중간에 실패했을 때 로그인은 풀렸는데 알람만 남는 상태가 됩니다. 테스트가 그 순서를 못 박습니다.
공유 코드를 지우는 쪽을 골랐습니다. #137 에서 미뤄 둔 판단입니다. 남겨 두면 같은 기기에 다른 사람이 로그인했을 때 앞 사람이 등록한 가족의 일정이 그대로 보입니다. 어르신 폰을 자녀가 잠깐 쓰는 일이 이 앱에서는 드물지 않아, 다시 입력하는 번거로움보다 남의 일정이 보이는 쪽이 나쁘다고 봤습니다.
여러 Repository 를 순서대로 조합하고 두 화면이 함께 쓰므로 UseCase 로 뒀습니다. 계정 삭제가 이미 같은 짝을
DeleteAccountUseCase에서 맞추고 있어 자리도 같습니다.📷 Screenshot
화면 변경 없습니다.
💬 To Reviewers
ktlintFormat·testDebugUnitTest(전 모듈 111개 통과) ·:app:lintDebug초록입니다.shareCodeWatchers)은 이 PR 에서 지우지 않습니다. 계정 삭제 경로는 지우지만, 로그아웃은 다시 돌아올 수 있는 상태이고 그 등록으로 나가는 푸시 자체가 fix: 결제 비활성화로 Cloud Functions 가 실행되지 않아 보호자 알림이 나가지 않는다 #102 로 막혀 있습니다. 로그아웃 중 네트워크 호출을 하나 더 늘리는 값이 지금은 없다고 봤습니다.