firebaseMessaging.sendEachForMulticast: app/network-error
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 50/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- node.js, typescript
- 领域
- backend
调研方向
从 issue 中所示的 firebaseMessaging.sendEachForMulticast 调用开始,在 development 模式下使用 firebase-admin 13.0.2 复现 app/network-error。将其行为与正常工作的 send 方法进行比较,并检查返回的响应。完成的标准是 multicast 发送成功且没有 HTTP/2 协议错误,或者已记录该失败并确认其原因及 workaround。
由索引模型根据 Issue 内容生成。
描述
export async function pushNotification({
identifiers,
body,
metadata,
title,
link,
}: PushMessage) {
try {
logger.debug(`Push Notification: ${JSON.stringify(identifiers)}`);
const userPreIdentifiers = identifiers.users;
const teamPreIdentifiers = identifiers.teams;
const userIdentifiers: string[] = [];
if (userPreIdentifiers === "allUsers") {
const allUserIdentifiers = await getAllUsersIdentifiers();
userIdentifiers.push(...allUserIdentifiers);
} else {
const userTokens = await getUserIdentifiers({
userRefs: userPreIdentifiers || [],
});
userIdentifiers.push(...(userTokens || []));
}
const teamIdentifiers = await getTeamIdentifiers({
teamRefs: teamPreIdentifiers || [],
});
const tokens = [...(userIdentifiers || []), ...(teamIdentifiers || [])];
logger.debug("All tokens:", tokens);
if (tokens.length === 0) {
logger.debug("No tokens found for push notification");
return;
}
const message: MulticastMessage = {
tokens,
notification: {
title,
body,
},
data: metadata as { [key: string]: string },
...(link && {
webpush: {
fcmOptions: {
link,
},
},
}),
};
const response =
await firebaseConfig.firebaseMessaging.sendEachForMulticast(message);
logger.debug(
`Successfully sent push notification: ${JSON.stringify(response)}`
);
} catch (error) {
logger.error("Error sending push notification:", error);
}
}
{"responses":[{"success":false,"error":{"code":"app/network-error","message":"Error while making request: Stream closed with error code NGHTTP2_PROTOCOL_ERROR. Error code: ERR_HTTP2_STREAM_ERROR"}}],"successCount":0,"failureCount":1}
I am using the "firebase-admin": "^13.0.2", sdk. The sendEachForMulticast not working on my development mode (did not try yet in production). However, if I am using the send method it will successfully push the notification.
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 422
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 18
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-admin-node 的其他 Issue
-
Password policy violation is reported as `auth/internal-error` instead of a specific error code可能已有人在做 @lahirumaramba 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
firebase/firebase-admin-node#3265 · 已指派 1 人 ·
维护者通常 1 天内回复
-
getToken() replays a failed token refresh to later callers while a valid token is cached可能已有人在做 @GUMBOKIM 于 57 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
firebase/firebase-admin-node#3234 ·
维护者通常 1 天内回复
-
[email protected] stable dependency tree fails npm audit via Storage uuid and Firestore google-gax可能重新可做 @lahirumaramba 于 32 天前认领,目前没有进行中的 PR。 未关闭
firebase/firebase-admin-node#3221 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Misleading error message for THIRD_PARTY_AUTH_ERROR: raw "OAuth 2 access token" text surfaced instead of the APNs-specific message可能已有人在做 @milcho0604 于 59 天前认领。 未关闭api: messaging
难度 3/5 1-2 天 新手友好度 70/100
firebase/firebase-admin-node#3215 ·
维护者通常 1 天内回复
-
api: messaging
难度 5/5 一周以上 新手友好度 28/100
firebase/firebase-admin-node#3214 ·
维护者通常 1 天内回复
查看 firebase/firebase-admin-node 的全部 Issue
相似的 Issue
-
area/frontend area/v2 kind/bug priority/needs-triage
难度 2/5 1-3 小时 新手友好度 70/100
kubeflow/notebooks#1498 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
P1
难度 2/5 1-3 小时 新手友好度 66/100
SuruchBoss/Cwork#90 ·
-
bug cli service
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#3922 ·