Conversation
📝 WalkthroughWalkthroughSpring 프로필 활성화 조건을 확대하고, 리마인더 서비스 메서드에 트랜잭션 처리 및 제어 흐름을 추가하는 변경입니다. 총 2개 파일에서 3줄이 수정되었습니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
🤖 Fix all issues with AI agents
In
`@src/main/java/site/dogether/notification/sender/performance_test/PerformanceTestNotificationSender.java`:
- Around line 10-12: PerformanceTestNotificationSender is marked
`@Profile`({"pt","dev","local"}) and `@Primary` which causes it to override
production senders like FcmNotificationSender in dev/local; restrict the bean to
only the performance-test profile or remove primary selection: either change the
`@Profile` on PerformanceTestNotificationSender to `@Profile`("pt") so it only loads
in the pt profile, or keep the broader `@Profile` but remove `@Primary` so
FcmNotificationSender remains the default; update the annotation on the
PerformanceTestNotificationSender class accordingly and ensure no other bean is
accidentally marked `@Primary`.
🧹 Nitpick comments (1)
src/main/java/site/dogether/reminder/service/TodoActivityReminderService.java (1)
38-46: 명시적 분기로 향후 enum 확장 시 오동작 방지현재 enum
DailyTodoActivityReminderType은TODO_CERTIFICATION과TODO_CERTIFICATION_REVIEW두 값만 가지고 있어 기존 코드는 정상 작동합니다. 그러나 else 절이 모든 non-TODO_CERTIFICATION 값을 암묵적으로 리뷰 리마인더로 처리하므로, 향후 enum에 새로운 값이 추가되면 예상치 못한 동작이 발생할 수 있습니다.switch 문으로 각 케이스를 명시적으로 처리하고 default에서 예외를 던지면 새로운 enum 값 추가 시 컴파일 타임에 처리를 강제할 수 있어 더 안전합니다.
명시적 분기 예시
- if (reminderType == TODO_CERTIFICATION) { - sendTodoCertificationReminder(requester, todoId); - return; - } - sendTodoCertificationReviewReminder(requester, todoId); + switch (reminderType) { + case TODO_CERTIFICATION: + sendTodoCertificationReminder(requester, todoId); + break; + case TODO_CERTIFICATION_REVIEW: + sendTodoCertificationReviewReminder(requester, todoId); + break; + default: + throw new IllegalArgumentException("지원하지 않는 reminderType: " + reminderType); + }
| @Slf4j | ||
| @Profile("pt") | ||
| @Profile({"pt", "dev", "local"}) | ||
| @Primary |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find all classes implementing NotificationSender
echo "=== NotificationSender implementations ==="
rg -n --type=java 'implements NotificationSender' -A 3 src/main/java/site/dogether/notification/sender
echo ""
echo "=== `@Profile` annotations in sender package ==="
rg -n --type=java '@Profile' -B 2 -A 1 src/main/java/site/dogether/notification/sender
echo ""
echo "=== `@Primary` annotations in sender package ==="
rg -n --type=java '@Primary' -B 3 -A 1 src/main/java/site/dogether/notification/sender
echo ""
echo "=== Directory structure of sender package ==="
find src/main/java/site/dogether/notification/sender -type f -name "*.java" | head -20Repository: dogether-project/dogether-backend
Length of output: 2914
dev/local 환경에서 성능 테스트용 Sender가 실제 Sender를 덮어쓰고 있습니다
현재 설정으로는 @Profile({"pt", "dev", "local"}) + @Primary 조합이 dev/local 환경에서 PerformanceTestNotificationSender를 기본 선택 빈으로 만듭니다. FcmNotificationSender(프로필 제한 없음)가 존재해도 @Primary로 인해 성능 테스트용 Sender가 우선되며, 520ms 지연이 모든 알림 요청에 적용됩니다.
성능 테스트 목적이라면 이 빈은 "pt" 프로필에만 활성화되어야 합니다. 의도한 동작이 아니라면 다음 중 하나를 적용해주세요:
옵션 1: 성능 테스트 프로필에만 제한
-@Profile({"pt", "dev", "local"})
+@Profile("pt")옵션 2: `@Primary` 제거
-@Primary📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @Slf4j | |
| @Profile("pt") | |
| @Profile({"pt", "dev", "local"}) | |
| @Primary | |
| `@Slf4j` | |
| `@Profile`("pt") | |
| `@Primary` |
| @Slf4j | |
| @Profile("pt") | |
| @Profile({"pt", "dev", "local"}) | |
| @Primary | |
| `@Slf4j` | |
| `@Profile`({"pt", "dev", "local"}) |
🤖 Prompt for AI Agents
In
`@src/main/java/site/dogether/notification/sender/performance_test/PerformanceTestNotificationSender.java`
around lines 10 - 12, PerformanceTestNotificationSender is marked
`@Profile`({"pt","dev","local"}) and `@Primary` which causes it to override
production senders like FcmNotificationSender in dev/local; restrict the bean to
only the performance-test profile or remove primary selection: either change the
`@Profile` on PerformanceTestNotificationSender to `@Profile`("pt") so it only loads
in the pt profile, or keep the broader `@Profile` but remove `@Primary` so
FcmNotificationSender remains the default; update the annotation on the
PerformanceTestNotificationSender class accordingly and ensure no other bean is
accidentally marked `@Primary`.
😉 연관 이슈
Resolves #256
🧑💻 수행 작업
📢 참고 사항
X
Summary by CodeRabbit
버그 수정
최적화