[FIX] ACTIVE 전환 시 Redis 유저 플래그 제거 시점 수정 - #46
Conversation
📝 WalkthroughWalkthroughRedis 순번 조회 실패 시 DB 재조회 처리를 Changes대기열 활성화 흐름 개선
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
src/main/java/com/michelet/waiting/application/service/WaitingService.java (1)
71-75: 💤 Low valueDB 재조회가 불필요하며, null position 발생 시 로깅 추가 권장
동일 트랜잭션 내에서
saved엔티티가 이미 존재하므로 DB 재조회는 불필요합니다. 또한 Redis position이 null인 경우는 비정상적인 상황이므로, 디버깅을 위해 경고 로그를 추가하는 것이 좋습니다.🔧 간소화 및 로깅 추가 제안
if (position == null) { - Waiting updated = waitingRepository.findById(saved.getId()) - .orElseThrow(() -> new WaitingException(WaitingErrorCode.NOT_FOUND)); - return WaitingResult.of(updated); + log.warn("[대기등록] Redis position 조회 실패 - restaurantId: {}, token: {}", + command.restaurantId(), saved.getToken().value()); + return WaitingResult.of(saved); }🤖 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/michelet/waiting/application/service/WaitingService.java` around lines 71 - 75, Remove the unnecessary DB re-query when position == null inside WaitingService: instead of calling waitingRepository.findById(saved.getId()) and throwing WaitingException, return WaitingResult.of(saved) (use the already persisted saved entity) and add a warning log entry that the Redis position was null (include identifying info like saved.getId() and any user/context fields) so the abnormal null position is recorded for debugging; keep the WaitingException only for true not-found scenarios elsewhere.
🤖 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.
Nitpick comments:
In `@src/main/java/com/michelet/waiting/application/service/WaitingService.java`:
- Around line 71-75: Remove the unnecessary DB re-query when position == null
inside WaitingService: instead of calling
waitingRepository.findById(saved.getId()) and throwing WaitingException, return
WaitingResult.of(saved) (use the already persisted saved entity) and add a
warning log entry that the Redis position was null (include identifying info
like saved.getId() and any user/context fields) so the abnormal null position is
recorded for debugging; keep the WaitingException only for true not-found
scenarios elsewhere.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 33d4cb35-1d70-40d2-8097-4637e858e0ff
📒 Files selected for processing (1)
src/main/java/com/michelet/waiting/application/service/WaitingService.java
📝 작업 내용
🚀 주요 변경 사항
✅ 자체 체크리스트 (필수)
./gradlew build실행 결과 정상 (인증샷 첨부)📸 테스트 인증샷
💬 리뷰어 전달사항 (선택)
📎 참고 자료
Summary by CodeRabbit
릴리스 노트
버그 수정
성능 개선