Skip to content

Fix FCM per-recipient result mapping - #281

Merged
alex-friedl merged 1 commit into
masterfrom
fix/fcm-response-mapping
Nov 24, 2026
Merged

alex-friedl merged 1 commit into
masterfrom
fix/fcm-response-mapping

Conversation

@alex-friedl

@alex-friedl alex-friedl commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes how FCM results are mapped for each token. A failed batch still rejects send(), as documented, so this is a patch release.

  • messageId is now read from the right field. It was always undefined before.
  • A token's error is passed through as is, so error.code (for example messaging/registration-token-not-registered) is kept.
  • When the response has no per-token results, every recipient is reported as failed, matching the entries.
  • An empty response rejects with a clear error instead of a TypeError.
  • The README no longer lists multicastId, which was never set.

Overlaps with #280 but doesn't replace it. #280 makes a failed batch resolve instead of reject, which would be a breaking change.

🤖 Generated with Claude Code

- Read messageId from the SendResponse field firebase-admin actually returns
- Pass per-token errors through unchanged so error.code is preserved
- Report every recipient as failed when the response has no per-token results
- Reject with a clear error on an empty response
- Remove the unreachable (response, err) branch

A failed batch still rejects send(), as documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alex-friedl
alex-friedl merged commit 1ecf69a into master Nov 24, 2026
8 checks passed
@alex-friedl
alex-friedl deleted the fix/fcm-response-mapping branch November 24, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant