Skip to content

iOS app: push switch spins forever and the phone never registers when the Expo push token request never settles #8392

Done

Description

@vv2002

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):

  1. Settings → Notifications → turn on notifications for a server reached through bb Connect.
  2. Watch the switch. On the server, run bb push-notifications list and 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.

  1. Create createPushRegistrationController with fakes: the store has profiles p1 and p2 enabled and no registration, getPermission returns "granted", getExpoPushToken returns new Promise(() => {}), and api.register counts calls.
  2. Call controller.sync(p1) (app start), then controller.setEnabled(p1, false) and controller.setEnabled(p1, true) (the user flips the switch), then controller.sync(p2) (another server).
  3. Read controller.getSnapshot() after a few seconds. Control run: the same, but getExpoPushToken resolves.

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

  • syncPushRegistration awaits the Expo push token with no timeout before it calls api.register: push-registration.ts#L140-L147, #L170-L179.
  • getExpoPushToken is Notifications.getExpoPushTokenAsync (the APNs device token, then a POST to exp.host): expo-push-module.ts#L70-L74.
  • runSync sets syncing: true and clears it only when the sync returns, and every sync runs on one shared operations queue: push-registration-controller.ts#L57-L64, #L98-L114. Later sync calls 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.list from localhost answers in 23 ms, Expo returns ok receipts 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

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 GENERATED and links the thread or report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions