[Refactor] 타이머 읽기와 쓰기를 Room 기준으로 전환 #587 - #601
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.
#️⃣연관된 이슈
Closes #587
📝작업 내용
타이머의 읽기와 쓰기를 Room 기준으로 옮겼습니다. 도메인 식별자를 서버 ID(
Long)에서localId(UUID)로 바꿨고, 화면은 진입 시 서버 목록을 반영한 뒤 로컬 스냅샷을 한 번 읽습니다. 쓰기는 로컬에 먼저 반영하고 재조회로 화면을 갱신합니다.도메인
SimpleTimer,CustomTimer가localId(필수)와serverId(nullable)를 갖습니다. 오프라인에서 만든 행은 서버 ID를 받기 전입니다Step에서 서버 스텝 id를 제거했습니다. 서버 수정이 전체 교체(PUT)라 스텝 ID가 왕복에서 유지된다는 보장이 없어order로 식별합니다GetLocalSimpleTimersUseCase,GetLocalCustomTimerListUseCase를 추가했습니다. 내 쓰기 직후에는 서버를 보지 않습니다EditCustomTimerNameUseCase를 삭제했습니다. 로컬이 원본이면 이름만 바뀐 경우를 나눌 이유가 없고, 전송 방식은 워커가 정합니다데이터
NETWORK_ERROR면 로컬 스냅샷을Success로 돌립니다. 그 밖의 오류는 그대로 전달합니다serverId로 항목별 매칭합니다.syncState != SYNCED행은 대체하지 않고 기존localId를 이어 씁니다NO_MEMBER_ID를 냅니다. 수정과 삭제는 대상 행을 특정할 수 없어 조용히 no-op입니다화면
customTimerId(long)→customTimerLocalId(string)으로 바꿨습니다. 생성 모드는 참조할 행이 없어-1L같은 sentinel 대신 nullable로 표현합니다GET_ERROR와TimerListViewModel.errorToast를 제거했습니다. 쓰기 실패 토스트는 남깁니다isSyncPending도 소비 지점이 없어 도메인 모델에서 제거했습니다. 동기화 상태를 화면에 드러낼 필요가 생기면 소비 지점과 함께 다시 넣습니다이 PR은 #586 위에 쌓았다가 base를
dev로 옮겼습니다.💬리뷰 요구사항(선택)
커스텀 타이머 목록을 읽을 때 항목마다 상세 GET을 부릅니다. 목록 GET이 스텝을 주지 않고 오프라인 실행에는 스텝이 필요해서인데, 지금 개수에서는 감수할 만하다고 봤습니다. 서버에 편집 시각이 붙는 api-server #574 이후 변경분만 받는 식으로 줄일 수 있습니다. 이 판단이 갈릴 것 같아 봐주시면 좋겠습니다.
타이머는
offline_cache_enabled플래그 대상이 아닙니다. 로컬이 원본이라 플래그를 끄면 전송 대기 행이 화면에서 사라집니다.심플 타이머 개수 상한(최대 6)은 이 PR에서 그대로 뒀습니다. 서버 정책이 살아 있어 앱이 먼저 풀면 워커가 초과 생성을 올릴 때 거부됩니다. 상한과 하한 제거는 서버 배포와 함께 별도 이슈로 진행합니다.
✅검증
ktlintCheck,:domain:test,:data:testDebugUnitTest,:feature:timer:testDebugUnitTest,:app:assembleDebug로컬 통과. base가dev이므로dev-ci도 함께 돕니다.