[fix] #197 - 반복 투두 완료 처리 시 타이머 검사를 날짜 단위로 변경 - #200
Conversation
다른 날짜의 타이머가 실행 중일 때 해당 규칙의 모든 날짜 완료가 막히던 문제를 수정. hasActiveTimer(todoId) 대신 날짜를 함께 확인하는 hasActiveTimerOn(todoId, date)으로 완료 가드를 변경했다. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough활성 타이머 조회에 목표 날짜 조건이 추가되었습니다. Changes날짜별 타이머 검사
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR limits completion blocking to timers running on the same date while preserving broader guards for rule-wide changes; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Jy000n
left a comment
There was a problem hiding this comment.
오옹 PR 잘 읽었숩니당 코드도 적절하게 잘 바꿔주신 것 같네용👍
|
|
||
| boolean existsByTodo_IdAndStatusIn(Long todoId, List<TimerStatus> statuses); | ||
|
|
||
| boolean existsByTodo_IdAndTargetDateAndStatusIn( |
There was a problem hiding this comment.
저 ".. Todo_Id .."에서 _가 뭘 의미하는 거였죠,, 합숙하면서 들었었는데 까먹었습니다..😥
There was a problem hiding this comment.
아하 todo의 id를 말합니다. 보통 sql문으로 쓸때는 todo.id로 불러올텐데 메서드명으로 쓸 때는 저렇게 Todo_Id로 표기하는 것으로 알고 있습니다
aneykrap
left a comment
There was a problem hiding this comment.
코드 잘 읽었습니당
hasActiveTimerOn(todoId, date)로 해서 이제 해당날짜에 실행중인 타이머만 완료처리가 가능해지겠어용!! 고생하셨습니다!
관련 이슈 🛠
작업 내용 요약 ✏️
반복 투두의 완료 처리 시, 다른 날짜의 타이머가 실행 중이면 해당 규칙의 모든 날짜 완료가 막히던 문제를 수정했습니다. Todo(규칙)와 TodoInstance(날짜별 실체)가 결합된 지점 중, 완료 가드가 날짜를 무시하고 규칙 단위로 타이머를 검사하던 것이 원인이었습니다.
주요 변경 사항 🛠️
TodoService.changeCompletion에서hasActiveTimer(todoId)→hasActiveTimerOn(todoId, date)로 변경하여, 해당 날짜에 실행 중인 타이머만 완료를 차단하도록 수정hasActiveTimerOn(todoId, date)추가existsByTodo_IdAndTargetDateAndStatusIn(todoId, targetDate, statuses)추가트러블 슈팅 ⚽️
todoId(규칙)만으로 활성 타이머를 검사 → 9/2 타이머 실행 중 9/3 완료가 불가능했습니다.targetDate로 날짜가 구분되지만, 완료 검사 로직만 날짜를 전달하지 않고 규칙 전체를 기준으로 판단했습니다.TimerService.startTimer에서targetDate가 항상 non-null(resolvedDate)로 저장되므로,targetDate기준 조회에서 활성 타이머가 누락되지 않음을 확인했습니다.updateTodo(스케줄·소요시간 변경),deleteTodo(규칙 전체 삭제)는 전 날짜에 영향을 주는 작업이므로 기존의 규칙 단위hasActiveTimer검사를 그대로 유지했습니다.테스트 결과 📄
compileJava통과. Swagger 수동 검증:스크린샷 📷
테스트는 '매일 반복 일정' 생성 -> 해당 반복 일정에 해당하는 타이머 하나 실행 -> 다른 반복 일정 완료 처리 진행



리뷰 요구사항 📢
Summary by CodeRabbit
기능 개선
동작 개선