You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks similar to #187, but that's been closed for years, so the similarity might no longer apply.
The crux of the issue is that not all scenarios of invalid registration IDs in FCM are supported equally. Particularly, there is the case of InvalidArgumentError due to an invalid registration ID which forces us to inspect the underlying HTTPError.
In other words, for us to handle all (known) scenarios where we should drop a particular registration ID, we currently have to:
try:
messaging.send(message)
except (
messaging.SenderIdMismatchError,
messaging.UnregisteredError,
messaging.ThirdPartyAuthError,
):
# Handle errors that require dropping the registration ID# This is reasonably ergonomic!passexceptexceptions.InvalidArgumentErrorase:
ife.http_responseand"Invalid registration token"ine.http_response.text:
# Handle errors that require dropping the registration ID# This is NOT ergonomic! Plus it relies on API internals not abstracted away by `firebase-admin-sdk`.pass
Is there any chance for first-party support of this error? Perhaps by re-raising as messaging.InvalidRegistrationIdError?
The text was updated successfully, but these errors were encountered:
[READ] Step 1: Are you in the right place?
Looks like it.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
This looks similar to #187, but that's been closed for years, so the similarity might no longer apply.
The crux of the issue is that not all scenarios of invalid registration IDs in FCM are supported equally. Particularly, there is the case of
InvalidArgumentError
due to an invalid registration ID which forces us to inspect the underlyingHTTPError
.In other words, for us to handle all (known) scenarios where we should drop a particular registration ID, we currently have to:
Is there any chance for first-party support of this error? Perhaps by re-raising as
messaging.InvalidRegistrationIdError
?The text was updated successfully, but these errors were encountered: