Skip to content

[FR] Auto-retry FCM requests that failed due to an internal error (messaging/internal-error) #2604

Open
@dkim-xeal

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)

export function defaultRetryConfig(): RetryConfig {

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 #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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions