Skip to content

[hotfix] #177 - todo 정렬 및 focus 탭 타이머 완료 여부 수정 - #189

Merged
laura-jung merged 3 commits into
developfrom
hotfix/#177-timer-error
Jul 16, 2026
Merged

laura-jung merged 3 commits into
developfrom
hotfix/#177-timer-error

Conversation

@laura-jung

@laura-jung laura-jung commented Jul 16, 2026 •

Copy link
Copy Markdown
Collaborator

관련 이슈 🛠

작업 내용 요약 ✏️

todo 정렬, focus 탭에 불러오는 todo targetDate 반영으로 수정했습니다

주요 변경 사항 🛠️

  • todo 정렬 방식 수정
  • focus 탭에 불러올 todo 선택시 targetDate 반영

스크린샷 📷

나도 테스트해보고 싶었는데 배포 환경에서만 순서가 보일 것 같아요....

Summary by CodeRabbit

  • 버그 수정
    • 활성 타이머에서 포커스 할 일을 조회할 때 타이머에 기록된 날짜를 기준으로 처리해 날짜 불일치 문제를 개선했습니다.
    • 타이머 시작, 상태 변경, 종료 시 해당 날짜의 할 일 항목이 기존 항목과 올바르게 연결되도록 개선했습니다.
    • 해당 날짜에 항목이 없을 경우 필요한 할 일 항목이 자동으로 생성됩니다.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@laura-jung, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b027901a-97e8-4054-8e27-1089e434393c

📥 Commits

Reviewing files that changed from the base of the PR and between 4fabf14 and 7edd467.

📒 Files selected for processing (1)
  • src/main/java/com/Timo/Timo/domain/todo/service/TodoInstanceReorderer.java

Walkthrough

타이머 생명주기의 TodoInstance 처리가 TodoInstanceReorderer로 통합되고, 활성 타이머의 포커스 날짜는 사용자 타임존 변환 대신 저장된 timerDate를 사용하도록 변경되었습니다.

Changes

Timer and focus flow

Layer / File(s) Summary
TodoInstance materialization
src/main/java/com/Timo/Timo/domain/todo/service/TodoInstanceReorderer.java
기존 일별 인스턴스를 우선 사용하고, 없으면 저장하는 materializeInstance 메서드가 추가되었습니다.
Timer lifecycle integration
src/main/java/com/Timo/Timo/domain/timer/service/TimerService.java
타이머 시작, 상태 변경, 종료 시 TodoInstance 생성을 TodoInstanceReorderer.materializeInstance 호출로 변경하고 기존 헬퍼와 저장소 의존성을 제거했습니다.
Active timer focus date
src/main/java/com/Timo/Timo/domain/focus/service/FocusService.java
활성 타이머 포커스 조회에서 사용자 타임존 변환을 제거하고 activeTimer.getTimerDate()를 사용합니다.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested labels: 🛠️ fix, slack-approval-notified

Suggested reviewers: aneykrap, jy000n

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 투두 정렬과 Focus 탭 타이머 완료 수정이라는 핵심 변경을 직접 반영합니다.
Linked Issues check ✅ Passed 비오늘 날짜 투두의 타이머 종료/완료 오류를 막기 위해 Focus/Timer 흐름과 인스턴스 재구성 로직이 수정되었습니다.
Out of Scope Changes check ✅ Passed 요약된 변경들은 모두 타이머 완료 오류와 투두 정렬 수정이라는 PR 목적에 부합합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/#177-timer-error

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aneykrap aneykrap left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넹 테스트 ㄱㄱ 가보시죠

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/Timo/Timo/domain/timer/service/TimerService.java (1)

193-201: 🩺 Stability & Availability | 🔴 Critical | 🏗️ Heavy lift

외부 API 호출 중 트랜잭션 경계 및 커넥션 점유 문제 해결

현재 completeTimer와 stopTimer 메서드에 @Transactional(readOnly = false)가 선언되어 있습니다. 이로 인해 내부의 finishTimer에서 TransactionTemplate를 사용해 트랜잭션을 분리하려던 의도와 다르게, 전체 로직이 하나의 거대한 외부 트랜잭션으로 묶이게 됩니다.

결과적으로 generateAiFeedback이라는 외부 시스템(AI) API 호출이 트랜잭션 내부에서 실행되며, 응답을 기다리는 동안 데이터베이스 커넥션을 계속 점유하게 되어 트래픽이 몰릴 때 커넥션 풀 고갈(Connection Pool Exhaustion) 장애를 유발할 수 있습니다. As per path instructions, 외부 시스템 호출, 데이터 접근, 도메인 규칙이 과하게 섞이지 않았는지 확인해 주세요. 또한 트랜잭션 경계가 적절한지 확인해 주세요.

메서드 레벨의 트랜잭션 전파 속성을 NOT_SUPPORTED로 설정하여 외부 호출 시 트랜잭션을 분리하고 DB 커넥션을 반환하도록 수정해야 합니다. (클래스 레벨에 @Transactional(readOnly = true)가 선언되어 있으므로, 어노테이션 제거 대신 NOT_SUPPORTED 명시가 필요합니다.)

🛠 제안하는 트랜잭션 경계 수정 방안
-  `@Transactional`(readOnly = false)
+  `@Transactional`(propagation = Propagation.NOT_SUPPORTED)
   public TimerFinishResponse completeTimer(Long userId, Long timerId) {
     return finishTimer(userId, timerId, TimerStatus.COMPLETED);
   }

-  `@Transactional`(readOnly = false)
+  `@Transactional`(propagation = Propagation.NOT_SUPPORTED)
   public TimerFinishResponse stopTimer(Long userId, Long timerId) {
     return finishTimer(userId, timerId, TimerStatus.STOPPED);
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/com/Timo/Timo/domain/timer/service/TimerService.java` around
lines 193 - 201, Update completeTimer and stopTimer to use
`@Transactional`(propagation = Propagation.NOT_SUPPORTED) instead of readOnly =
false, preserving their delegation to finishTimer. Ensure the required
Propagation symbol is imported, so any surrounding transaction is suspended
while the external generateAiFeedback flow executes and database connections are
not held.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/com/Timo/Timo/domain/todo/service/TodoInstanceReorderer.java`:
- Around line 85-94: Update materializeInstance to query
todoInstanceRepository.findByTodo_IdAndDate first and return the existing
instance immediately. Only call materializeDayGroup when that lookup is empty,
then preserve the current group lookup and creation behavior for missing
instances while retaining handling for Todo records not present on the requested
date.

---

Outside diff comments:
In `@src/main/java/com/Timo/Timo/domain/timer/service/TimerService.java`:
- Around line 193-201: Update completeTimer and stopTimer to use
`@Transactional`(propagation = Propagation.NOT_SUPPORTED) instead of readOnly =
false, preserving their delegation to finishTimer. Ensure the required
Propagation symbol is imported, so any surrounding transaction is suspended
while the external generateAiFeedback flow executes and database connections are
not held.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 53977c34-938a-40bc-8868-74ca908236ad

📥 Commits

Reviewing files that changed from the base of the PR and between 7c24ecc and 4fabf14.

📒 Files selected for processing (3)
  • src/main/java/com/Timo/Timo/domain/focus/service/FocusService.java
  • src/main/java/com/Timo/Timo/domain/timer/service/TimerService.java
  • src/main/java/com/Timo/Timo/domain/todo/service/TodoInstanceReorderer.java

@Jy000n Jy000n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

귣귣

@github-actions github-actions Bot added the slack-approval-notified Slack 승인 완료 알림 중복 방지용 라벨 label Jul 16, 2026
@laura-jung
laura-jung merged commit 5f7fee4 into develop Jul 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍀 윤아 🚨 hotfix slack-approval-notified Slack 승인 완료 알림 중복 방지용 라벨

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[hotfix] 타이머 종료/완료 에러 수정

3 participants