[Bug]: iOS Local Network permission sheet leaves pairing stuck until force-quit
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Closest related: #4921 (closed after documenting force-quit as a workaround). This issue is specifically about recovering in-process after the Local Network permission sheet, without requiring a cold start.
Area
apps/mobile (connection supervisor / AppState wakeups)
Steps to reproduce
- Fresh iOS install (or reset Local Network permission for T3 Code).
- Enable Network access on the desktop environment and create a pairing link.
- On iPhone, add/pair the environment over LAN (
http://192.168.x.x:3773). - When iOS shows the Local Network permission prompt, tap Allow.
- Observe the environment stay in
Failed to connect. Reconnecting…even though permission is granted and the desktop server is reachable. - Force-quit and reopen the iOS app — connection succeeds.
Expected behavior
After the user taps Allow, the in-flight (or immediately subsequent) connection attempt should recover and connect without force-quitting the app.
Actual behavior
The permission sheet briefly moves the app to inactive and back. That resume is emitted as application-active-probe, but during establishment the supervisor consumes and ignores probe wakeups. The attempt that triggered the sheet is usually already doomed, so the client falls into backoff and does not immediately replace the attempt with one that can use the newly granted Local Network access. Force-quit is the only reliable recovery today — bad UX.
Impact
Major degradation or frequent failure for first-time LAN pairing on iOS.
Version or commit
Reproduced against current main-line mobile connection runtime behavior (see waitForEstablishmentInterrupt in packages/client-runtime/src/connection/supervisor.ts and mobile AppState wakeups).
Environment
- iOS native app
- Desktop / server with Network access enabled
- Direct LAN pairing (same Wi-Fi)
Workaround
Force-quit and reopen the iOS app after granting Local Network.
Proposed fix (small / focused)
- During establishment, treat application-active wakeups (including probe) as an interrupt that resets the retry ladder.
- On mobile, treat AppState
inactiveas a suspension start so permission sheets are tracked the same way as brief backgrounding.
Happy to open a tightly scoped PR for this once maintainers want it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/client-runtime/src/connection/supervisor.ts at waitForEstablishmentInterrupt, then trace the mobile AppState wakeups and application-active-probe handling. Reproduce the iOS Local Network permission flow and verify that granting access replaces the failed establishment attempt and connects without a force-quit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- mobile, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100