Repository navigation
[hotfix] #177 - todo 정렬 및 focus 탭 타이머 완료 여부 수정 - #189
Conversation
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Walkthrough타이머 생명주기의 TodoInstance 처리가 ChangesTimer and focus flow
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
src/main/java/com/Timo/Timo/domain/focus/service/FocusService.javasrc/main/java/com/Timo/Timo/domain/timer/service/TimerService.javasrc/main/java/com/Timo/Timo/domain/todo/service/TodoInstanceReorderer.java
관련 이슈 🛠
작업 내용 요약 ✏️
todo 정렬, focus 탭에 불러오는 todo targetDate 반영으로 수정했습니다
주요 변경 사항 🛠️
스크린샷 📷
나도 테스트해보고 싶었는데 배포 환경에서만 순서가 보일 것 같아요....
Summary by CodeRabbit