[#602] 앱이 독에 내려갔을 때 Todo Fetch 요청이 되는 현상을 해결한다#657
Conversation
There was a problem hiding this comment.
Code Review
이번 풀 리퀘스트는 활성화된 위젯 종류에 따라 필요한 스냅샷만 선택적으로 갱신하도록 개선하고, 앱이 백그라운드로 진입할 때 날짜 변경 여부 및 동기화 요청 상태를 확인하여 효율적으로 동기화를 수행하도록 수정합니다. 이에 대해 WidgetSyncEventBusImpl에서 스레드 안전성을 확보하고 데드락을 방지하기 위해 NSRecursiveLock을 도입하고 publish(_:) 메서드를 보호할 것을 제안했습니다. 또한, confirmRequest() 메서드에 @discardableResult 속성을 추가하여 불필요한 _ = 대입 식을 제거하고 코드를 더 깔끔하게 개선할 것을 권장했습니다.
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
이번 풀 리퀘스트는 위젯 동기화 방식을 매번 네트워크에서 전체 데이터를 가져오는 방식에서 로컬 스냅샷을 증분 업데이트하는 방식으로 개선하고, Today 위젯 스냅샷 구조를 단순화하는 변경을 포함하고 있습니다. 리뷰 결과, 1) deleteTodoSnapshot에서 todayTodos를 먼저 삭제하여 힙맵에 삭제 활동이 누락되는 버그, 2) TodoDraft 생성 시 number가 nil이라 위젯에서 누락되는 문제, 3) restoreTodoSnapshot에서 sourceTodo(id:) 중복 호출을 줄이는 최적화 방안이 제시되었습니다.
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.
🔗 연관된 이슈
🎯 의도
📝 작업 내용
📌 요약
TodayWidgetSectionSnapshot제거 및WidgetTodayTodoSnapshot기반 item 저장 구조로 정리🔍 상세
WidgetSessionSyncHandler에서 로그인 세션이 활성화될 때.syncRequested를 발행해 Today, Heatmap 원본 데이터를 최초 구성DevLogApp의scenePhase == .background처리에서 같은 날 반복 동기화를 막고, 날짜가 변경된 경우에만.syncRequested발행WidgetSyncEventHandler의.refreshRequested처리에서 기존 원본을 사용해 Today, Heatmap 스냅샷만 재생성TodoRepositoryImpl의 Todo 추가, 수정, 삭제, 복구 성공 후WidgetSnapshotUpdater를 통해 위젯 원본과 스냅샷 갱신UserPreferencesRepositoryImpl의 Today 표시 옵션 및 Heatmap 활동 설정 변경 후.refreshRequested발행WidgetSnapshotUpdaterImpl에서 Today, Heatmap 원본을 메모리에 유지하고 설정 변경이나 Todo 변경 시 저장된 원본 기준으로 스냅샷 재생성TodayWidgetSnapshotFactory에서 Today 표시 순서 기준 최대 3개 항목만 snapshot item으로 저장WidgetTodoSnapshotItem대신WidgetHeatmapDaySnapshot과 이름 결이 맞는WidgetTodayTodoSnapshot사용작업 노트
WidgetCenter의 현재 설정 정보가 즉시 반영되지 않는 케이스가 있어 제거📸 영상 / 이미지 (Optional)