[Feat] 타이머를 로컬 원본으로 전환 #586 - #600
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 #586
📝작업 내용
타이머의 원본을 기기로 옮기는 저장층입니다. 화면 전환은 #587에서 합니다.
테이블 두 개를 추가하고 DB 버전을 2로 올렸습니다.
simple_timer와custom_timer이고 둘 다memberId와localId가 PK,serverId는 nullable입니다. 커스텀 타이머의 스텝은 JSON 컬럼에 담았습니다. 스텝만 따로 조회할 일이 없고 서버 수정이 전체 교체라 타이머 하나가 판정 단위입니다. 스텝에 서버 ID는 담지 않았습니다. PUT 왕복에서 유지된다는 보장이 없습니다.TimerLocalDataSource가 계정 조건과 상태 전이를 담당합니다.CREATE_PENDING,createRequestId발급DELETE_PENDING으로 표시만 합니다TimerRepositoryImpl의 성공 폴백 두 개를 걷었습니다.addSimpleTimer가-1L을,getCustomTimer가 빈CustomTimer를 성공으로 돌려주고 있었습니다. 로컬이 원본이 되면 그 값이 저장돼 복구할 수 없는 행이 됩니다. 이제MAPPING_ERROR로 떨어집니다.테스트 12건을 붙였습니다. 상태 전이 5건, 개수와 정렬 2건, 커스텀 스텝 2건, 대기 행 조회 1건, 계정 경계 2건입니다.
:data:testDebugUnitTest41건과:app:assembleDebug통과입니다.#599위에 쌓았습니다. 버전을 올리는 변경이라 그 PR의 재생성 정책이 선행입니다.스크린샷 (선택)
화면 변화가 없습니다. 저장층만 추가했습니다.
💬리뷰 요구사항(선택)
커스텀 타이머 스텝을 별도 테이블이 아니라 JSON 컬럼으로 뒀습니다. 스텝 단위 조회나 정렬이 필요해지면 테이블 분리로 바꿔야 합니다. 지금 판단이 맞는지 봐주세요.
전송 중 스냅샷 컬럼(
inFlightEditId등)은 넣지 않았습니다. 워커가 쓸 값이라 #588에서 추가합니다. 출시 전이라 스키마를 다시 바꿔도 비용이 없습니다.CI
dev-ci는 base가dev인 PR에만 돕니다. 이 PR은 스택이라 검사가 붙지 않습니다. 로컬에서ktlintCheck,:data:testDebugUnitTest41건,:app:assembleDebug를 돌렸습니다. 부모 PR이 머지되면 base를 옮겨 CI를 태우겠습니다.