Skip to content

feat(fcm): Enable fid and deprecate token for Send API#3145

Open
yvonnep165 wants to merge 9 commits into
mainfrom
yp-add-fid-arg
Open

feat(fcm): Enable fid and deprecate token for Send API#3145
yvonnep165 wants to merge 9 commits into
mainfrom
yp-add-fid-arg

Conversation

@yvonnep165
Copy link
Copy Markdown

@yvonnep165 yvonnep165 commented May 13, 2026

This change deprecates TokenMessage interface and the tokens field in MulticastMessage interface as message targets, transitioning support to FidMessage interface and fids in MulticastMessage as the primary targets instead.

The multicast helper function sendEachForMulticast is updated to support both target types concurrently up to a combined total of 500.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Firebase Installation IDs (FIDs) in the messaging service by adding the FidMessage interface and updating the Message union type. The MulticastMessage interface now supports targeting via fids, and the tokens field has been deprecated and made optional. Feedback includes suggestions to add documentation for the new FidMessage interface, refactor the message construction logic using object destructuring for better maintainability, and improve the grammar of validation error messages. Additionally, the reviewer noted that making tokens optional is a breaking change for TypeScript consumers that should be highlighted in release notes.

Comment thread src/messaging/messaging-api.ts
Comment on lines 58 to 70
export interface MulticastMessage extends BaseMessage {
tokens: string[];
/**
* A list of Firebase Installation IDs (FIDs) to target.
*/
fids?: string[];

/**
* A list of registration tokens to target.
*
* @deprecated Use {@link MulticastMessage.fids} instead.
*/
tokens?: string[];
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Changing tokens from a required field (tokens: string[]) to an optional one (tokens?: string[]) in the MulticastMessage interface is a breaking change for TypeScript consumers who might be relying on the property's presence (e.g., accessing .length without a null check). While necessary for the migration to fids, this should be clearly highlighted in the release notes.

Comment thread src/messaging/messaging.ts Outdated
Comment thread src/messaging/messaging.ts Outdated
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