Skip to content

Keep the event stream open in the iOS app switcher - #110

Merged
eivindjonassen merged 1 commit into
mainfrom
fix/ios-app-switcher-stale-notice
Nov 14, 2026
Merged

eivindjonassen merged 1 commit into
mainfrom
fix/ios-app-switcher-stale-notice

Conversation

@eivindjonassen

Copy link
Copy Markdown
Member

Summary

On an iPhone, swiping up to the app switcher showed "Request status is stale. Reconnect to check pending requests." and "Showing saved data until the server reconnects." on the workspace card, every time.

  • Cause. iOS reports inactive while the app switcher, Control Center, Notification Center, or a system prompt covers the app. The transport treated every state other than active as background. It closed the event stream and set the status to stale, and after the 1-second notice delay both warnings appeared.
  • Fix. A new isTransportForeground treats only background as leaving the foreground. The transport's startup state and the AppState listener both use it, for the coordinator and for TanStack Query focus. inactive keeps the stream open.
  • Unchanged. Leaving for another app still reaches background, closes the stream, and reconnects on return. Android does not report inactive.

This change is already published as an EAS Update to preview (runtime 0.1.6), built on 87974aa plus this change, after both native fingerprints matched the installed baseline.

Verification

  • pnpm check (1533 mobile tests, adapter tests, both Hermes exports)
  • pnpm native:doctor (18/18)
  • pnpm crap --threshold 30
  • Tests cover the changed behavior: inactive at startup keeps the transport in the foreground, an inactive change keeps query focus, and background still drops it.
  • Platform behavior is verified on the affected targets, or the gap is documented. Not verified on a device yet; the gap is recorded in docs/COMPATIBILITY.md. Check that no notice appears while hovering in the app switcher, and that switching to another app and back reconnects cleanly.
  • No credentials, addresses, identifiers, user content, private paths, or deployment files are included.
  • Documentation and TODO.md reflect the resulting behavior.

iOS reports "inactive" while the app switcher, Control Center,
Notification Center, or a system prompt covers the app. The transport
treated every state other than "active" as background, so swiping up to
switch apps closed the event stream and showed the stale-request and
saved-data notices on the workspace card.

Only "background" now closes the stream and pauses query focus.
Leaving for another app still reaches "background" and reconnects on
return.
@eivindjonassen
eivindjonassen merged commit 34f5f70 into main Nov 14, 2026
4 checks passed
@eivindjonassen
eivindjonassen deleted the fix/ios-app-switcher-stale-notice branch November 14, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant