[Messaging] sendEachForMulticast with a lot of tokens throws error
@jonathanedey is already working on this.
Since Jun 24, 2025.
Assessment
This issue has not been assessed yet.
Description
[READ] Step 1: Are you in the right place?
- For issues related to the code in this repository file a Github issue.
- If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
template. - For general technical questions, post a question on StackOverflow
with the firebase tag. - For general Firebase discussion, use the firebase-talk
google group. - For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Operating System version: Docker version 28.0.1, build 068a01e (image is: oven/bun:1.2.12-alpine)
- Firebase SDK version: 13.4.0
- Firebase Product: messaging
- Node.js version: v20.18.0
- NPM version: 10.8.2
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
When using Http/2 with sendEachForMulticast will throw an error (Error while making requests: GOAWAY - exceeded_max_concurrent_streams, Error code: 1) when sending with a lot fcm tokens (lowest that i have tested that got rejected is 214)
if legacy http transport is enabled, this issue does not occur.
best guess why this happens is the fact that it sends a request for every token, therefore sending up to 500 requests at once which is too many for the http/2 implemenation of it.
Relevant Code:
const app = admin.initializeApp();
const messaging = app.messaging();
const tokens = []; // List of a lot of FCM tokens
try {
const result = await messaging.sendEachForMulticast({ tokens });
} catch (err) {
console.error(err);
}
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-admin-node
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 comments · 1 assignee ·
-
api: messaging
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Difficulty 5/5 Over a week Newbie friendliness 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comment · 1 assignee ·
All issues in firebase/firebase-admin-node
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100