[#302] FCM토큰이 유효하지 않을 때, 에러가 뜨고 로컬 세션이 유지되는 이슈를 해결한다#303
Conversation
opficdev
commented
Mar 19, 2026
- closed FCM토큰이 유효하지 않을 때, 에러가 뜨고 로컬 세션이 유지되는 이슈를 해결한다 #302
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 FCM 토큰이 유효하지 않을 때 로컬 세션이 유지되고 오류가 발생하는 문제를 해결합니다. 애플리케이션의 인증 세션 관리를 대폭 리팩토링하여, 인증 상태 처리를 Combine 퍼블리셔를 사용하는 AuthService 내에서 중앙화하고, 리포지토리 및 유스케이스의 중복된 세션 관리 로직을 제거했습니다. 또한, 모든 '초기 실행' 관련 로직을 제거하여 애플리케이션의 초기 상태를 단순화하고 복잡성을 줄였습니다. 로그아웃 프로세스도 개선하여 인증 오류 발생 시에도 완전한 세션 정리가 보장됩니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
이 PR은 인증 및 세션 관리 로직을 크게 리팩토링하여 FCM 토큰이 유효하지 않을 때 로컬 세션이 유지되는 문제를 해결합니다. AuthService에 Firebase의 addStateDidChangeListener를 사용하여 인증 상태 관리를 중앙집중화한 점이 인상적입니다. 이로 인해 AuthService가 인증 상태의 단일 진실 공급원(Single Source of Truth)이 되어, 여러 ViewModel과 Repository에서 수동으로 세션 상태를 관리할 필요가 없어졌습니다. 코드의 복잡성이 줄고 안정성이 향상되었습니다. 또한, 문제가 되었던 '첫 실행' 관련 로직을 제거하여 초기 앱 흐름을 단순화한 점도 좋은 개선입니다. 전반적으로 아키텍처를 개선하고 버그를 수정한 훌륭한 변경입니다.
| private let messaging = Messaging.messaging() | ||
| private let logger = Logger(category: "AuthService") | ||
| private let subject = CurrentValueSubject<Bool, Never>(Auth.auth().currentUser != nil) | ||
| private var handler: AuthStateDidChangeListenerHandle? |