[#539] LoginView에 TCA를 적용한다#541
Conversation
There was a problem hiding this comment.
Code Review
This pull request renames the custom Store protocol to StorePattern across the codebase to prevent naming conflicts, migrates the login flow from the custom MVI pattern to Composable Architecture (TCA) with the introduction of LoginFeature, and enhances concurrency safety by adopting Sendable conformances and introducing thread-safe wrappers like FirebaseDependency and UserDefaultsDependency. The review feedback recommends using NSRecursiveLock instead of NSLock in AuthStatePublisher to avoid potential deadlocks from synchronous subscriber re-entrancy, and suggests declaring loginStore as a constant (let) rather than @State in RootView to follow TCA best practices.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
🔗 연관된 이슈
🎯 의도
LoginView의 상태 관리 흐름을 TCA 기반LoginFeature로 전환Sendable경고를 정리하기 위함📝 작업 내용
📌 요약
LoginViewModel기반 로그인 흐름을LoginFeature기반으로 변경Store프로토콜명을StorePattern으로 변경해 TCAStore와 이름 충돌 방지LoginFeatureTests를 기존 테스트 시나리오와 호환되는 형태로 구성SignInUseCase체인과 로그인/인증 서비스 프로토콜에Sendable적용🔍 상세
LoginView가 직접 ViewModel을 소유하지 않고StoreOf<LoginFeature>를 주입받도록 변경RootView와DevLogApp에서 로그인 Store 생성 및 의존성 주입을 담당하도록 구성LoginViewModelTests를LoginFeatureTests로 전환하고, 테스트 드라이버는feature중심으로 정리AuthService,AuthenticationService,UserService,WidgetSnapshotPreferenceStore,WidgetSnapshotUpdater,AuthenticationRepository에Sendable계약 추가FirebaseDependency로 감싸고 필요한 공개 API만 노출UserDefaultsDependency로 감싸서 처리AuthServiceImpl의 auth state 관찰은 현재 Combine 기반CurrentValueSubject를 유지하되, Sendable 처리를 위해 내부 publisher 객체로 분리검토 요청:
AuthServiceImpl의 인증 상태 관찰은 현재 Combine 기반으로 유지되어 있음Sendable모델과 잘 맞지 않아@unchecked Sendable, lock, 내부 래퍼가 필요해지는 구조임AsyncStream<Bool>기반으로 전환하면 concurrency 모델과 더 자연스럽게 맞을 수 있어 보임observeSignedIn() -> AnyPublisher<Bool, Never>계약 변경이 필요하므로, 이번 PR에서는 유지하고 후속 작업으로AsyncStream전환 여부 검토 요청📸 영상 / 이미지 (Optional)