Skip to content

fix(logging): silence AUTHENTICATION_FAILED and INTERNAL_SERVER_ERROR from Bugsnag - #1437

Open
bmc08gt wants to merge 1 commit into
code/cashfrom
fix/logging-fcm-transient-errors
Open

fix(logging): silence AUTHENTICATION_FAILED and INTERNAL_SERVER_ERROR from Bugsnag#1437
bmc08gt wants to merge 1 commit into
code/cashfrom
fix/logging-fcm-transient-errors

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Bugsnag 6a9df0a95ab98605a9dfcb88 picked up on 2026.8.5 internal: 57 events from 4 devices in three days, 17 of them from one Samsung SM-A556E relaunching mid-onboarding. The inner cause is IOException("AUTHENTICATION_FAILED") (47) or IOException("INTERNAL_SERVER_ERROR") (10) thrown by Play Services out of FirebaseMessaging.getToken(), wrapped by the SDK as IOException("FCM Registration failed!") -> ExecutionException.

ErrorUtils.gmsTransientMessages already drops SERVICE_NOT_AVAILABLE, FIS_AUTH_ERROR, MISSING_INSTANCEID_SERVICE and TOO_MANY_REGISTRATIONS, each added by an earlier round of this triage (#943 and predecessors). These two codes were never added, so FirebasePushTokenProvider reports them through ErrorUtils.handleError on every login.

This is not a regression. 2026.8.5 ships Firebase BOM 34.17.0, the same as 2026.8.2 through 2026.8.4, out since Aug 20. The 34.18.0 bump is not in any tagged release. The same codes show up in the older, unwrapped groups on builds back to 2025.7.4, and INTERNAL_SERVER_ERROR is one Firebase's own GmsRpc.isErrorMessageForRetryableError retries on.

Changes:

  • Add AUTHENTICATION_FAILED, INTERNAL_SERVER_ERROR, Firebase's alternate spelling InternalServerError, and PHONE_REGISTRATION_ERROR (seen once in the sibling group on 2026.8.4) to gmsTransientMessages.
  • Make isGmsTransientError internal and cover the nested FCM Registration failed! shape plus a negative case in ErrorUtilsTest.

Behaviour for users is unchanged. The provider already resumes null on failure and updateFcmToken() returns early, so push stays unregistered until a later login succeeds.

… from Bugsnag

FirebaseMessaging.getToken() fails inside Play Services with
IOException("AUTHENTICATION_FAILED") or IOException("INTERNAL_SERVER_ERROR"),
wrapped as IOException("FCM Registration failed!") -> ExecutionException.
Neither code was in gmsTransientMessages, so FirebasePushTokenProvider reported
every failure. Bugsnag 6a9df0a95ab98605a9dfcb88 has 57 events from 4 devices
on 2026.8.5, 17 of them from one phone relaunching mid-onboarding.

Both strings come from GMS on the device, not app code. INTERNAL_SERVER_ERROR
is one Firebase's GmsRpc already treats as retryable. Add both, Firebase's
alternate spelling InternalServerError, and PHONE_REGISTRATION_ERROR, which
appeared once in the same group on 2026.8.4. Behaviour is unchanged: the
provider already resumes null and updateFcmToken() returns early.

isGmsTransientError is now internal so the nested exception shape is covered
by ErrorUtilsTest.
@bmc08gt bmc08gt self-assigned this Sep 9, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant