-
Notifications
You must be signed in to change notification settings - Fork 4
[Feat] Notification 추가 #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- FCM 설정 - DB import
워크스루FCM 알림 전송 기능에서 Notification 페이로드를 추가하여 사용자 및 토픽 메시지 전송 메서드를 개선했습니다. 변경사항
추정 코드 리뷰 노력🎯 2 (Simple) | ⏱️ ~8분
관련 가능성 있는 PR
제안 리뷰어
시
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/ku_rum/backend/domain/alarm/application/FcmService.java(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
src/main/java/ku_rum/backend/domain/alarm/application/FcmService.java (2)
10-10: LGTM: 필요한 import 추가Notification 클래스를 사용하기 위한 import가 올바르게 추가되었습니다.
75-83: 토픽 메시지에도 알림 페이로드 일관성있게 추가Message 빌더에 notification 페이로드가
sendToUsers와 동일한 패턴으로 추가되어 일관성이 유지됩니다. 토픽 기반 알림도 이제 시스템 알림으로 자동 표시됩니다.
|
|
||
| MulticastMessage message = MulticastMessage.builder() | ||
| .addAllTokens(tokens) | ||
| .setNotification( | ||
| Notification.builder() | ||
| .setTitle(request.title()) | ||
| .setBody(request.body()) | ||
| .build() | ||
| ) | ||
| .putData("title", request.title()) | ||
| .putData("body", request.body()) | ||
| .build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
fd FcmService.java -type fRepository: KU-rum/backend
Length of output: 228
🏁 Script executed:
find . -name "FcmService.java" -type f | head -5Repository: KU-rum/backend
Length of output: 129
🏁 Script executed:
rg "issue.*358|error.*1404" -i --max-count 20Repository: KU-rum/backend
Length of output: 213
🏁 Script executed:
cat -n src/main/java/ku_rum/backend/domain/alarm/application/FcmService.javaRepository: KU-rum/backend
Length of output: 6172
🏁 Script executed:
rg "FCM_SEND_ERROR|1404" -B 5 -A 5 src/main/java/ku_rum/backend/global/support/status/BaseExceptionResponseStatus.javaRepository: KU-rum/backend
Length of output: 734
🏁 Script executed:
git log --oneline -20 -- src/main/java/ku_rum/backend/domain/alarm/application/FcmService.javaRepository: KU-rum/backend
Length of output: 139
FCM 알림 페이로드 추가로 시스템 알림 자동 표시 개선
MulticastMessage에 notification 페이로드가 올바르게 추가되었습니다. Notification.builder().setTitle().setBody().build() 패턴은 Firebase Admin SDK의 공식 권장 방식이며, 이를 통해 시스템 알림이 자동으로 표시됩니다. Data 페이로드와 notification 페이로드를 동시에 사용하는 것은 유효한 패턴입니다.
sendToTopic() 메서드(75-80행)도 동일한 패턴으로 일관성 있게 구현되어 있습니다.
🤖 Prompt for AI Agents
In src/main/java/ku_rum/backend/domain/alarm/application/FcmService.java around
lines 47 to 58, ensure the MulticastMessage includes a Notification payload so
system notifications are shown automatically; replace the current
MulticastMessage construction with one that uses
Notification.builder().setTitle(request.title()).setBody(request.body()).build(),
adds all tokens via addAllTokens(tokens), and also includes the same data keys
(putData("title", request.title()) and putData("body", request.body())) so it
matches the sendToTopic implementation and provides both notification and data
payloads.
Test Results 37 files 37 suites 10s ⏱️ Results for commit 7960d2c. |
#️⃣ 연관된 이슈
closes #358
📝작업 내용
작업 상세 내용
상세 내용을 입력해주세요.
💬리뷰 요구사항
Summary by CodeRabbit
새로운 기능
✏️ Tip: You can customize this high-level summary in your review settings.