[FR] Auto-retry FCM requests that failed due to an internal error (messaging/internal-error)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js, typescript
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bcgov/bc-wallet-mobile#4761 · 1 comment ·
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100