Conversation
- SSE emitter 콜백에서 race condition 방지 (remove(userId) → remove(userId, emitter)) - discountRate 서버 검증 추가 (10/20/30/40 외 값 400 에러 반환) - markAllAsRead N+1 개선 (벌크 UPDATE 쿼리로 변경) - INVALID_DISCOUNT_RATE 에러 코드 추가 (ALERT-002) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough알림 저장소에 사용자별 미확인 알림을 일괄 읽음으로 표시하는 벌크 업데이트 메서드를 추가했고, 서비스는 이를 사용하도록 변경했습니다. SSE 에미터 제거 시 값 기반 삭제로 경합을 방지하도록 수정했으며, 가격 알림 생성/수정에 할인율 유효성 검증과 에러 코드를 추가했습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/main/java/com/ongil/backend/domain/notification/service/NotificationSseService.java`:
- Around line 34-47: In NotificationSseService, the IOException catch blocks
currently call emitters.remove(userId) which can remove a newly registered
emitter from another thread; change those two occurrences to
emitters.remove(userId, emitter) so the removal is conditional on the exact
SseEmitter instance (making it consistent with the onCompletion, onTimeout, and
onError callbacks). Locate the IOException handling in the methods that call
emitter.send(...) and replace the key-only remove with the conditional remove
using the same emitter variable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b7800dda-dd97-45f4-84f0-ece15e24b127
📒 Files selected for processing (5)
src/main/java/com/ongil/backend/domain/notification/repository/NotificationRepository.javasrc/main/java/com/ongil/backend/domain/notification/service/NotificationService.javasrc/main/java/com/ongil/backend/domain/notification/service/NotificationSseService.javasrc/main/java/com/ongil/backend/domain/pricealert/service/PriceAlertService.javasrc/main/java/com/ongil/backend/global/common/exception/ErrorCode.java
src/main/java/com/ongil/backend/domain/notification/service/NotificationSseService.java
Show resolved
Hide resolved
emitters.remove(userId) → remove(userId, emitter)로 통일 subscribe()와 sendNotification()의 IOException catch 블록 누락 수정 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🔍️ 작업 내용
할인 알림 및 SSE 알림 버그 수정
✨ 상세 설명
🛠️ 추후 리팩토링 및 고도화 계획
📸 스크린샷 (선택)
💬 리뷰 요구사항
Summary by CodeRabbit
새 기능
버그 수정
성능 개선