Android push-token failures are reported as successful notification registration#26530

opened14d agobyBbompus

What happened

Two Android users report never receiving a notification despite granting permission and enabling notification settings. The reporting user confirms using a locally built nightly APK. The other installation and exact installed revisions remain unverified.

The investigation found a concrete registration failure on current main that can hide the problem. If Android cannot obtain its Firebase push token, the app can still report that notifications are enabled.

Diagnosis

In nativePushTokenRegistration, getDevicePushTokenAsync() errors are logged and converted to null. Registration continues without a token and with notificationsEnabled: false. A successful relay response sets the device status to registered, which the Notifications screen treats as successful notification setup.

This also affects a previously working device. A transient token-fetch error sends a new registration with notifications disabled, overwriting the relay's accepted notification preference. Keeping the previous token in the database does not preserve that preference.

A locally built preview APK from nightly 3824 contains neither google_app_id nor gcm_defaultSenderId. Expo's Android token module requires a configured Firebase Messaging instance. That explains why this APK cannot obtain a push token. The inspected artifact is the most recent local build available; its identity with the installed APK has not been checked.

The official t3code-android-internal-2.2.0-725.apk attached to the same nightly release contains both Firebase resources. It uses com.t3tools.t3code; the local preview uses com.t3tools.t3code.preview. Their embedded relay and Clerk application settings match. Upstream already documents the T3CODE_ANDROID_GOOGLE_SERVICES_FILE requirement in docs/operations/android-notifications.md. The local builder checked sign-in configuration but omitted the Firebase setup. This report therefore does not establish a general Android or Google Play delivery failure; the upstream defect is the false-success registration handling.

Steps to reproduce

  1. Use an Android build without Firebase configuration, sign in to T3 Connect, and grant notification permission.
  2. Enable Device Notifications in Settings. The native token lookup fails, but the relay registration proceeds without a token and the app reports success if the relay accepts it.
  3. A deterministic regression through the production registration function reproduces the same failure with notification permission granted and the external token API rejecting. It expects registration to fail and no disabling relay write; current main reports registered.

The device steps are source-traced, not executed in this investigation. The regression was executed before and after the patch.

Version

Source: main 5211acfe95a0. Inspected artifact: locally built preview 2.2.0 from nightly v0.1.4-nightly.20261028.3824, eb751fa0730d. Google Play version unverified.

Environment

Android notification registration; expo-notifications 58.1.5. No device runtime or Firebase network delivery tested.

Evidence

shell
1Baseline regression: expected "failed", received "registered".
2Patched registration suite: 15 passed.
3APK resources: google_app_id absent; gcm_defaultSenderId absent.
4check:changed upstream/main: format, lint, both knip passes, affected typechecks and registration tests passed.

#24053 concerns subagent approval publishing; #24933 separates muted alerts from ongoing activity; #10863 concerns broader delivery diagnostics. This report concerns token-fetch failures being treated as successful registration.

Fix applied or workaround

A focused local patch propagates Android token-fetch failures into the existing registration failure handling. Initial registration can retry, and a failed refresh preserves the accepted relay registration. I can submit a pull request for this fix after the required review and Android verification.

Missing Firebase configuration still requires rebuilding with T3CODE_ANDROID_GOOGLE_SERVICES_FILE for the correct package and Firebase project. This patch does not supply that configuration or claim to restore end-to-end delivery by itself.

Filed by

GPT-6.1 Sol in Codex through T3 Code.

Synced from GitHub

Is com.t3tools.t3code.preview registered in the Firebase project used by T3's hosted relay, and can its matching google-services.json be made available for local builds? No service-account credentials are needed.