Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import site.dogether.notification.sender.NotificationSender;

@Slf4j
@Profile("pt")
@Profile({"pt", "dev", "local"})
@Primary
Comment on lines 10 to 12
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 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 -20

Repository: 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.

Suggested change
@Slf4j
@Profile("pt")
@Profile({"pt", "dev", "local"})
@Primary
`@Slf4j`
`@Profile`("pt")
`@Primary`
Suggested change
@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`.

@Component
public class PerformanceTestNotificationSender implements NotificationSender {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ public class TodoActivityReminderService {
private final TodoActivityReminderHistoryRepository todoActivityReminderHistoryRepository;
private final NotificationService notificationService;

@Transactional
public void sendReminder(final Long requesterId, final Long todoId, final DailyTodoActivityReminderType reminderType) {
final Member requester = getMember(requesterId);

if (reminderType == TODO_CERTIFICATION) {
sendTodoCertificationReminder(requester, todoId);
return;
}
sendTodoCertificationReviewReminder(requester, todoId);
}
Expand Down
Loading