firebase / firebase/firebase-admin-node
[FR] Auto-retry FCM requests that failed due to an internal error (messaging/internal-error)
- 主要语言
- TypeScript
- 星标
- 1.7k
- 派生
- 419
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 16
描述
**Is your feature request related to a problem? Please describe.**
Our Sentry has captured about 20,000 messaging/internal-error errors. This means that due to some internal FCM error, we haven't sent 20,000 push notifications to our users.
**Describe the solution you'd like**
FCM documentation recommends retrying such requests. https://firebase.google.com/docs/cloud-messaging/send-message#admin.
Currently, the library retries 503 requests but not 500 (messaging/internal-error returns 500) https://github.com/firebase/firebase-admin-node/blob/b5c4f5ae551249b64632baf2ece7b5c594a1965f/src/utils/api-request.ts#L202
It would be nice to change the default retry configuration or allow library users to use their own retry configs. It seems the solution is already implemented in https://github.com/firebase/firebase-admin-node/pull/1739 but stuck in review phase for 2 years.
**Describe alternatives you've considered**
I considered writing a custom wrapper around the FCM error, but it appears that FCM doesn't expose the Retry-After header, making it unclear how long the wrapper should wait before making another request.
Additionally, copying and pasting the same wrapper in each project that uses FCM is a very frustrating experience
贡献指南
调研方向
Start with src/utils/api-request.ts at the retry handling referenced in the issue, then review Firebase Cloud Messaging's retry guidance and pull request #1739. The change should cover messaging/internal-error responses and either update the default retry configuration or allow custom retry configurations.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- node.js, typescript
- 领域
- api, backend
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100