Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Messaging] sendEachForMulticast with a lot of tokens throws error

未关闭
#2,943 1 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

@jonathanedey 已经在做这个了。

开始于 2025年6月24日。

评估

这个 Issue 还没有评估数据。

描述

api: messaging
[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);
}
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
4 天 20 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-admin-node 的其他 Issue

查看 firebase/firebase-admin-node 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。