fix: guard against blank FCM device tokens in sendMessageWithResult#2168
Merged
taejinn merged 2 commits intofix/2164-notification-duplicationfrom Mar 5, 2026
Merged
Conversation
Co-authored-by: taejinn <140797244+taejinn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update to address feedback on duplicate notification error fix
fix: guard against blank FCM device tokens in sendMessageWithResult
Mar 5, 2026
taejinn
added a commit
that referenced
this pull request
Mar 10, 2026
* fix: 게시글 단위 키워드 알림 중복 발송 방지 * test: 키워드 알림 중복 방지 테스트 추가 * fix: 알림 상태 저장을 원자적 업서트로 변경 * fix: 키워드 이벤트 흐름의 지연 로딩 의존 제거 * fix: 키워드 구독 조회시 사용자 fetch join 적용 * fix: 업서트 쿼리에서 deprecated VALUES 함수 제거 * fix: 기발송 사용자 조회를 일괄 쿼리로 최적화 * fix: 키워드 알림 상태를 전송 성공 후 기록하도록 변경 * fix: FCM 전송 결과 메서드의 예외 처리 범위 확장 * test: 키워드 알림 전송 실패시 상태 미기록 테스트 추가 * fix: 알림 전송 메서드의 트랜잭션 경계 분리 * fix: 기발송 조회 대상을 매칭 사용자로 한정 * fix: 전송 성공 시에만 알림 레코드 저장 * fix: guard against blank FCM device tokens in sendMessageWithResult (#2168) * Initial plan * fix: use StringUtils.hasText to guard against blank FCM tokens Co-authored-by: taejinn <140797244+taejinn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: taejinn <140797244+taejinn@users.noreply.github.com> * fix: 알림 전송 메서드가 호출자 트랜잭션에 참여하도록 수정 * fix: 배치 알림 전송 예외를 개별 처리하도록 수정 * fix: 키워드 알림 조회와 푸시 전송 흐름을 개선 * fix: 전송 결과 알림은 성공 시에만 저장하도록 수정 * fix: 발송 후 알림 저장을 별도 트랜잭션으로 분리 --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sendMessageWithResultonly checkedtargetDeviceToken == null, allowing empty or whitespace-only tokens to pass through and trigger unnecessary Firebase calls and warn-level log noise.Change
Replace the null check with
!StringUtils.hasText(targetDeviceToken)to early-returnfalsefor null, empty, and whitespace tokens:Uses
org.springframework.util.StringUtils, already present in the project.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.