[Fix] APNs silent push 설정을 추가#136
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! iOS 환경에서 data-only FCM 메시지가 백그라운드 상태에서도 정상적으로 처리될 수 있도록 APNs 설정을 최적화했습니다. 기존의 알림 로직은 유지하면서, dataOnly 조건에 따라 silent push를 명시적으로 설정하도록 변경하여 안정성을 높였습니다. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
이번 풀이 리퀘스트는 FCM 서비스(FcmService)에서 데이터 전용(silent push) 메시지 전송을 지원하기 위해 APNs 설정을 추가하는 변경 사항을 포함하고 있습니다. 리뷰어는 silentPushApnsConfig() 메서드가 호출될 때마다 매번 새로운 ApnsConfig 객체를 생성하는 대신, 불변 객체이므로 private static final 상수로 선언하여 재사용하도록 리팩토링할 것을 제안했습니다. 이는 불필요한 객체 생성을 방지하고 성능 및 가독성을 향상시키는 유용한 피드백입니다.
| private ApnsConfig silentPushApnsConfig() { | ||
| return ApnsConfig.builder() | ||
| .setAps(Aps.builder() | ||
| .setContentAvailable(true) | ||
| .build()) | ||
| .build(); | ||
| } |
There was a problem hiding this comment.
silentPushApnsConfig() 메서드는 호출될 때마다 새로운 ApnsConfig 객체를 생성합니다. 이 설정 객체는 불변(immutable)이며 내용이 항상 동일하므로, private static final 상수로 선언하여 재사용하는 것이 더 효율적입니다.
다음과 같이 클래스 수준의 상수로 변경하고 sendMessage 메서드에서 직접 참조하도록 리팩토링하는 것을 권장합니다. 이렇게 하면 불필요한 객체 생성을 방지하고 코드의 가독성을 높일 수 있습니다.
// FcmService 클래스에 추가
private static final ApnsConfig SILENT_PUSH_APNS_CONFIG = ApnsConfig.builder()
.setAps(Aps.builder().setContentAvailable(true).build())
.build();
// sendMessage 메서드 내에서 변경
if (dataOnly) {
builder.setApnsConfig(SILENT_PUSH_APNS_CONFIG);
}
// silentPushApnsConfig() 메서드는 제거됩니다.
🧾 요약
🔗 이슈
✨ 변경 내용
✅ 확인
com.semosan.api.domain.notification.dispatcher.AsyncNotificationDispatcherTest