[Fix] 트래킹 중 푸시 알림이 늦게 나가는 현상 수정#123
Conversation
📝 WalkthroughWalkthroughFCM notification payload construction is refactored to conditionally exclude the Notification part for tracking alerts while keeping it for general notifications. NotificationType enum gains a dataOnly flag, FcmService uses it to conditionally build the Notification, and AsyncNotificationDispatcher wires the flag through while simplifying extras handling. ChangesData-Only Notification Payloads for Tracking Alerts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/com/semosan/api/domain/notification/dispatcher/AsyncNotificationDispatcherTest.java (1)
61-97: ⚡ Quick winAdd a dedicated
TRACKING_SUMMIT_REACHEDcase.The data-only behavior now lives on each enum constant, but this suite only pins
TRACKING_PHOTO_MILESTONE. A mistaken flag onTRACKING_SUMMIT_REACHEDwould regress that notification path without failing here.🤖 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/test/java/com/semosan/api/domain/notification/dispatcher/AsyncNotificationDispatcherTest.java` around lines 61 - 97, The test dispatchKeepsGeneralNotificationPayload currently only verifies data-only behavior for TRACKING_PHOTO_MILESTONE; add a dedicated assertion/test for NotificationType.TRACKING_SUMMIT_REACHED to prevent regressions if its data-only flag changes. Update AsyncNotificationDispatcherTest by either adding a new test method (or an additional block in dispatchKeepsGeneralNotificationPayload) that constructs a NotificationDispatchCommand with NotificationType.TRACKING_SUMMIT_REACHED (same title/body/data shape and token) and verifies via the fcmService ArgumentCaptor that the sent data contains the expected common entries ("type", "title", "body") and doesNotContainKey("extras") (or the exact expected behavior for that enum). Ensure you reference AsyncNotificationDispatcher.dispatch and NotificationDispatchCommand when adding the new assertion so the test covers TRACKING_SUMMIT_REACHED explicitly.
🤖 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/test/java/com/semosan/api/domain/notification/dispatcher/AsyncNotificationDispatcherTest.java`:
- Around line 61-97: The test dispatchKeepsGeneralNotificationPayload currently
only verifies data-only behavior for TRACKING_PHOTO_MILESTONE; add a dedicated
assertion/test for NotificationType.TRACKING_SUMMIT_REACHED to prevent
regressions if its data-only flag changes. Update
AsyncNotificationDispatcherTest by either adding a new test method (or an
additional block in dispatchKeepsGeneralNotificationPayload) that constructs a
NotificationDispatchCommand with NotificationType.TRACKING_SUMMIT_REACHED (same
title/body/data shape and token) and verifies via the fcmService ArgumentCaptor
that the sent data contains the expected common entries ("type", "title",
"body") and doesNotContainKey("extras") (or the exact expected behavior for that
enum). Ensure you reference AsyncNotificationDispatcher.dispatch and
NotificationDispatchCommand when adding the new assertion so the test covers
TRACKING_SUMMIT_REACHED explicitly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 61d961fc-dc04-41a9-9649-80c6851520c0
📒 Files selected for processing (4)
src/main/java/com/semosan/api/common/fcm/FcmService.javasrc/main/java/com/semosan/api/domain/notification/dispatcher/AsyncNotificationDispatcher.javasrc/main/java/com/semosan/api/domain/notification/enums/NotificationType.javasrc/test/java/com/semosan/api/domain/notification/dispatcher/AsyncNotificationDispatcherTest.java
🧾 요약
🔗 이슈
✨ 변경 내용
✅ 확인
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests