[#532] Todo 카테고리가 무지성 fetch되는 현상을 해결한다#562
Conversation
There was a problem hiding this comment.
Code Review
이번 풀 request는 카테고리 선호도(Category Preference) 데이터의 캐싱 로직을 도입하고, 로그인 세션 상태 관리를 위해 AuthSessionStateProvider를 추가하며, WidgetTodoSnapshotRepositoryImpl이 TodoRepository 대신 TodoService를 직접 사용하도록 리팩토링하는 변경 사항을 포함하고 있습니다. 리뷰 피드백으로는 1) AuthSessionRepositoryImpl에서 Combine 대신 AsyncStream을 사용하여 비동기 스트림을 처리할 것, 2) UserDefaultsStoreImpl에서 디코딩 실패 시 데이터를 강제로 삭제하는 로직이 데이터 유실을 유발할 수 있으므로 단순히 nil을 반환하도록 수정할 것, 3) 여러 레포지토리에 중복 구현된 캐싱 로직을 TodoCategoryRepository로 단일화하여 결합도를 낮추고 중복을 제거할 것을 권장합니다.
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.
|
/gemini review |
There was a problem hiding this comment.
Code Review
이번 풀 리퀘스트는 카테고리 선호도 데이터를 메모리에 캐싱하기 위해 MemoryCacheStore를 도입하고, 로그인 세션 상태를 관리하기 위해 AuthSessionStateProvider를 추가하는 변경 사항을 포함하고 있습니다. 또한, WidgetTodoSnapshotRepositoryImpl이 TodoRepository 대신 TodoService를 직접 의존하도록 리팩토링되었으며, RootViewModel에서 화면 진입 시점에 관찰을 시작하도록 개선되었습니다. 리뷰 피드백으로는 MemoryCacheStoreImpl에서 불필요한 JSON 직렬화/역직렬화 오버헤드를 제거하고 NSLock을 사용하여 우선순위 역전을 방지할 것과, AuthSessionRepositoryImpl에서 Future와 Task를 혼용하는 Combine 안티패턴을 개선하여 구조를 단순화할 것을 제안했습니다.
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.
🔗 연관된 이슈
🎯 의도
TodoCategoryPreference조회가 여러 경로에서 반복 호출되는 흐름 개선📝 작업 내용
📌 요약
TodoCategoryPreferenceResponse를UserDefaultsStore에 저장 가능한 캐시 대상으로 정리TodoRepository를 거치지 않고TodoService를 직접 사용하도록 정리🔍 상세
UserDefaultsStore에 Codable value 저장/조회 API 추가TodoCategoryPreferenceResponse에 Codable 채택AuthSessionRepositoryImpl에서 signed-in 상태일 때 category preference 캐싱 후 session state publishAuthSessionStateProvider를 통해 캐싱 완료 이후 위젯 세션 동기화 흐름 연결TodoRepositoryImpl,TodoCategoryRepositoryImpl,PushNotificationRepositoryImpl에서 동일한 UserDefaults key 기반 category preference 캐시 사용WidgetTodoSnapshotRepositoryImpl은 category resolve가 필요 없으므로TodoRepository의존 제거 후TodoService응답을 snapshot으로 직접 매핑RootViewModel의 session/network/theme 구독을 init에서 제거하고 onAppear에서 1회만 시작하도록 변경AuthSessionRepositoryImpl에서 auth state 중복 방출을 캐싱 side effect 이전에 제거📸 영상 / 이미지 (Optional)