Repository navigation
Description
Summary
On an iPhone, the server's switch in Settings → Notifications shows a spinner forever and cannot be toggled, and the phone never registers for push, also after reinstalling the app. A capture on the server shows the app never sends pushSubscriptions.add (no pushSubscriptions.* call at all), while its other push-notifications requests arrive fine. Expected: registration succeeds, or fails with a visible error and the switch stays usable.
Versions and environment
- Server: bb 0.50.1, npm global install (
bb-app), Ubuntu 22.04.5, Node v24.22.3, systemd service bound to 127.0.0.1 - The phone reaches the server through bb Connect (connect mode)
- iOS app from the App Store, build 123 (native User-Agent
bb/123 CFNetwork/3896.200.61 Darwin/27.2.0), reinstalled on 2026-11-30 - One device. It registered fine on 2026-11-28 (subscription last refreshed 2026-11-29 21:53 UTC); the hang started after that
- Code path checked at main
9fc30ffb51(expo-notifications ~58.1.8)
Steps to reproduce
On the affected phone (not deterministic: the phone has to be in the state where the token request never settles):
- Settings → Notifications → turn on notifications for a server reached through bb Connect.
- Watch the switch. On the server, run
bb push-notifications listand capture HTTP requests to the bb port.
Deterministic, at the exact code path: the real push-registration-controller.ts and push-registration.ts from 9fc30ffb51, run with Node 24 type stripping, with the @/lib/describe-error and ./push-subscriptions-api imports replaced by stubs.
- Create
createPushRegistrationControllerwith fakes: the store has profilesp1andp2enabled and no registration,getPermissionreturns"granted",getExpoPushTokenreturnsnew Promise(() => {}), andapi.registercounts calls. - Call
controller.sync(p1)(app start), thencontroller.setEnabled(p1, false)andcontroller.setEnabled(p1, true)(the user flips the switch), thencontroller.sync(p2)(another server). - Read
controller.getSnapshot()after a few seconds. Control run: the same, butgetExpoPushTokenresolves.
Expected vs actual
Actual on the phone:
- The switch shows a spinner and is disabled. Status before the reinstall: "On · registered with this server". The same hang after the reinstall.
- `bb push-notifications list` still shows only the subscription from 2026-11-28, lastSeenAt 2026-11-29T21:53:53Z.
- Loopback capture of the bb port on 2026-11-30, 13:15-14:06 UTC: more than 30 requests with iPhone User-Agents to the push-notifications plugin (GET /api/v1/plugins/push-notifications/settings, POST .../rpc/threadNotifications.keyed, one GET .../settings from the native UA; the plugin was also turned off and on from the WebView: POST .../disable, POST .../enable). Not a single POST .../rpc/pushSubscriptions.add, .list or .remove.
Actual in the harness at 9fc30ffb51 (getExpoPushToken never settles):
after app start sync, 1s: p1.syncing=true p1.lastOutcome=null tokenCalls=1 registerCalls=0
after toggling off and on, 1s: p1.syncing=true p1.lastOutcome=null tokenCalls=1 registerCalls=0 (neither setEnabled promise settled)
after a sync for another server, 3s: p1.syncing=true p2.syncing=true tokenCalls=1 registerCalls=0 (nothing settled)
Control (getExpoPushToken resolves):
after app start sync, 1s: p1.syncing=false p1.lastOutcome={"action":"registered",...} registerCalls=1
after toggling off and on, 1s: both setEnabled promises settled, registerCalls=2
after a sync for another server, 3s: p2.syncing=false, registerCalls=3
Expected: the token step gives up after a bounded time. The sync ends with action "failed", step "token", the status shows "Could not register: ...", the switch is usable again, and syncs for other servers are not blocked.
Evidence
syncPushRegistrationawaits the Expo push token with no timeout before it callsapi.register: push-registration.ts#L140-L147, #L170-L179.getExpoPushTokenisNotifications.getExpoPushTokenAsync(the APNs device token, then a POST to exp.host): expo-push-module.ts#L70-L74.runSyncsetssyncing: trueand clears it only when the sync returns, and every sync runs on one sharedoperationsqueue: push-registration-controller.ts#L57-L64, #L98-L114. Latersynccalls for the same profile join the in-flight promise: #L116-L121.- The switch is disabled and shows the pending spinner while
syncing: NotificationsSettingsScreen.tsx#L46-L50. - With a stored registration and no outcome yet, the status reads "On · registered with this server": push-registration.ts#L254. That matches the screenshot.
- The server side works:
POST /api/v1/plugins/push-notifications/rpc/pushSubscriptions.listfrom localhost answers in 23 ms, Expo returnsokreceipts for test pushes to the old token, and exp.host and the Apple push hosts are reachable from the server. - Investigated in a bb thread on a private self-hosted server, so there is no public link.
What you ruled out
- Not Mobile app fetches the Expo push token from exp.host twice on every resume #8224 or Fetch the Expo push token once per device token on mobile #8225: they cover redundant token fetches on resume. Here the first fetch never settles, and Fetch the Expo push token once per device token on mobile #8225 still fetches once at cold start.
- Not Mobile pushes fail when registered devices use different Expo projects #7578: one registered device, and Expo accepts the pushes.
- Not the server: the plugin is running, the mobile channel is on, other plugin RPCs from the same app arrive, and the registration RPC answers locally.
- Reinstalling the app, force-quitting it, toggling the VPN on the phone and checking the iOS notification permission changed nothing.
- Not determined: which part of
getExpoPushTokenAsynchangs on the phone (the APNs device token or the exp.host request). The app shows no error.
AGENT GENERATED
Suggested priority and effort (optional)
medium:%20push%20never%20works%20on%20an%20affected%20phone%20and%20fails%20silently,%20no%20workaround%20in%20the%20app,%20no%20data%20loss.%20Effort%20probably%20Low%20(a%20timeout%20around%20the%20token%20step).
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
Activity
Give up on a stuck push token request on mobile (#8419)
Give up on a stuck push token request on mobile (get-bb#8419)