Skip to content

fix(mobile): recover a lost Relay credential rotation without re-pairing - #49338

Merged
brennanb2025 merged 48 commits into
mainfrom
brennanb2025/fix-mobile-relay-credential
Nov 30, 2026
Merged

brennanb2025 merged 48 commits into
mainfrom
brennanb2025/fix-mobile-relay-credential

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Sometimes the phone and the desktop swap the phone's Relay pass for a new one, and the phone gets cut off before it hears back. The desktop then only accepts the new pass, but the phone keeps using the old one. After a day the phone can't connect over Relay at all, and the app told people to re-pair, even though the phone was holding the new pass the whole time.

Now the phone tries that new pass when the old one is refused, and keeps it once it works. When Relay still refuses the phone, the app says to connect once on the desktop's network to refresh Relay access, or re-pair, instead of always saying re-pair.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​295 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​295
Prod 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​314 $\color{#cf222e}{\Huge{\mathbf{−}}}$​56 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​258

What Changed

  • Rotation recovery over Relay. The phone already saves the new token (pending) before it asks the desktop to install it. relayDialCandidates now lists current, grace, then a lease for pending. Because the install is gated on expectedCurrentHash, a committed install always gets version current + 1, so the phone can dial it with the version it will be accepted as. applyResumeConfirmation promotes pending to current, and the old current to grace, whenever the relay's resume confirmation names pending's version as current. That covers both a dial with pending and a dial with the old token while it is still in its 24h grace, so most phones adopt the new token before they are ever refused. The bundle is written the same way as after a rotation over a direct connection. A connected Relay session already lifts the fresh-credential gate. pending is dialed only after the relay refuses current and grace, so a normal in-flight rotation is unchanged.
  • Director refusals. A director 401 can be stale, because it reads a store that a host moved to the edge may have outgrown. So it doesn't condemn the token. The same attempt then tries only pending, because the cell that sent the phone to the director can know only that newer install, and redialing current or grace there would just get the same wrong-cell answer. The next attempt tries pending first, with its own director lookup, so a phone whose desktop moved to another Relay cell finds it. Current stays eligible and gets the lookup again on the attempt after that, so a stale 401 never locks out a valid current. Only promoting pending retires it. One attempt asks the director at most once. A director answer that names the same cell no longer rewrites the saved routing.
  • Retries. pending is tried once per ordinary recovery attempt, after current and grace, behind the existing retry backoff and credential gates. A relay-hello refusal of pending is treated as temporary, because the relay may not have stored the install yet: pending is never marked refused, so it stays dialable. Its refusals take the existing slow credential retry (about a minute, growing to 15),. pending is cleared, as before, on promotion, re-pair or a direct rotation. Only a refusal of a token the relay is known to have stored (current or grace) retires it. A 4404 (host offline) keeps its normal 5 to 15 second retry. A relay-hello refusal shows "Relay refused access" on the first refusal, and stays shown when a later token in the same attempt fails without a verdict (for example a director 503). Gated retries also honor a director Retry-After.
  • Quiet retries. While "Relay refused access", " is offline" or a desktop sign-in prompt is showing, retries don't publish connecting states, which would refresh the whole Home host list.
  • Bookkeeping. The running phone picks up pending as soon as it is saved, so a reply lost mid-session can be recovered without a restart. A promotion clears the old refusals, so the next direct connection doesn't force another rotation. Relay stops trying further tokens once a direct connection has already won.
  • Refusal advice. "Relay refused access for " now reads "Connect once on 's network to refresh Relay access, or re-pair" (all locales). The diagnostics advice for a relay-hello 4401 and for a director 401 now says the same thing. The pairing-invalid verdict, which comes from the desktop rejecting the phone's key, still says re-pair.
  • Host offline vs refused. The relay checks the credential before it checks whether the desktop is attached, so a refusal hides an offline desktop. Once the pending token is accepted, a desktop that is offline shows as " is offline" (4404) instead of hiding behind the refusal.
  • Copy report adds Relay credential: current vN expires …; grace …; pending yes|no for hosts with Relay. It includes versions and expiries only, never tokens or hashes, and shares one keychain read with one 2 second deadline per host, so repeated taps never stack reads.

Why

Today the credential only rotates over a direct connection, so a phone that is only on cellular can't recover from a lost rotation reply without re-pairing. The relay already holds the new token as current, so dialing with it fixes the most likely cause and needs no relay or desktop change. A full refresh over Relay, authorized by the phone's device key, needs a new relay admission mode. That will be a separate follow-up.

Linked Issue

Related to #47490.

Visual Proof

N/A. The only visible change is the detail line under "Relay refused access for " and the extra line in Copy report, both shown above.

Testing

  • Mobile typecheck (app and tests), check:changed, and the mobile transport, diagnostics, pairing and session suites pass.
  • Regression tests: one run for both a relay-hello refusal and a director 401: a real rotateMobileRelayCredential commits and then loses its reply, the relay refuses the old token, and the next Relay dial connects with pending and persists it as current v3 with no pending. It fails with the selection change reverted.
  • Regression test for a host that moved Relay cells after a lost rotation reply: the phone recovers with pending on a later attempt.
  • Regression test for a pending that keeps being refused: it backs off to the slow credential retry.
  • Device QA

Performance

At most one extra dial per recovery attempt, and only after the relay has already refused current and grace, or after a director 401. Each attempt asks the director at most once. Retries use the existing backoff and gates, and retries under a steady refused, offline or signed-out verdict publish nothing. Copy report does one keychain read per tap, shared across taps with a 2 second deadline.

Risk

Level: Low. If pending never committed and the relay also refuses current and grace, the phone shows "Relay refused access" as today and retries pending on the slow credential retry, quietly, until a direct connection refreshes the credential, or the phone is re-paired. If the director keeps answering 401, each attempt costs one extra dial, at the normal backoff. If the pending lease is wrong, the relay refuses it and the phone ends up in the same fresh-credential gate as today. A plain revert undoes it. A bundle that has already been promoted stays valid, because it matches the relay's current row.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Mobile only, no platform-specific paths. Older desktops and relays are unaffected: the relay and desktop protocol is unchanged.

Follow-ups

  • Smarter retries for an unconfirmed pending (removed from this PR). An earlier revision treated pending as speculative and gave it its own retry policy. Review kept finding new timing edge cases in that policy, so it was taken out, and this PR tries pending once per ordinary recovery attempt instead. The design, for a separate PR:

    • Don't mark pending refused on a relay-hello refusal, because its install can still commit a moment later. Instead, give it 3 failed tries, then pause, with one try per window that doubles from 5 minutes to an hour. A 4404 doesn't count as a failure.
    • Put failures with an unconfirmed token (pending, or a possibly stale director 401) behind the external-signal gate. An app resume or a real network move refills pending's tries. Repeated network callbacks lift the gate at most once per 30 seconds, and only when the lift could dial something.
    • Make one owner responsible for retrying a due lease replacement while the old Relay session is still connected and the replacement failed into a gate. Network lifts, the focus nudge and backgrounding must not cancel that retry, and a gated failure must keep the newest director Retry-After.
    • Order tokens by when the director last answered them, so the director's one lookup per window doesn't always go to current.
    • Skip the keychain reread while pending is proven by a 4404 or paused.
  • A saved endpoint written as an IPv4-mapped IPv6 link-local address ([::ffff:a9fe:…]) gets the "connect once on the network" advice instead of re-pair; the short link-local check doesn't parse that form.

  • The Copy report line "Relay credential: none" also shows when the keychain read misses its 2 second deadline; it could say "unreadable" in that case.

  • The director-401 diagnosis doesn't give link-local hosts the re-pair advice that the relay-hello diagnosis gives them.

  • A director Retry-After is a floor only for the failure that starts a gated wait, not for later gated retries.

  • Refresh a refused Relay credential over Relay itself, authorized by the phone's device key, so a phone that never reaches the desktop directly doesn't need to re-pair. This needs a new relay admission mode and an install authorization mode, so it's a separate change across the relay, the desktop and the phone.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-mobile-relay-credential branch from 7346e77 to 8acf118 Compare November 25, 2026 23:29
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status at 9508860

Problem: a phone whose Relay credential rotation committed on the relay, but whose reply was lost, kept dialing its old token. Once the relay's 24h grace ended, a phone that couldn't reach the desktop directly was stuck until it re-paired.

Change: the phone now tries its saved new token after the old ones are refused, and adopts it from the relay's confirmation. It also adopts it while the old token is still in grace. Refusal advice says to connect once on the desktop's network and to re-pair if Relay still refuses. Copy report shows the saved credential's versions, expiry and pending state.

Retry behavior: unconfirmed tokens (the new token, or a director 401) retry on the slow schedule. The new token pauses after three failures, and a resume or network move ends the pause; otherwise it gets one try per window, doubling up to an hour. Host-offline keeps its normal fast retry.

Verified: the root and mobile typechecks, the import-boundary check and the mobile tests (25 files, 90 tests) pass on Windows at this head. The regression test fails with the fix reverted.

Deferred (listed under Follow-ups in the description): refreshing a refused credential over Relay itself; re-reading the saved credential on each host-offline retry while only the new token is left; Home refreshes from failed tries of the new token (capped by the pause windows).

@brennanb2025
brennanb2025 marked this pull request as ready for review November 26, 2026 07:34
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Relay credential selection and recovery now account for pending credentials, director refusals, and unconfirmed failures. Network and resume events can refill the pending-credential retry budget. Diagnostics reports can include credential status using an abortable, time-limited read. Connection-health and diagnostic guidance now describes same-network Relay access refresh, with updated translations.

Merge Risk: Low · previous review 4551e

Relay credential recovery now tries the saved pending credential. When the retry gate is held, a server-supplied Retry-After may be ignored, so a reconnect probe can fire slightly early. This is a minor timing issue that is safe to merge with follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: recovering a lost Relay credential rotation so the phone can reconnect without re-pairing. The changeset adds a pending-credential dial path, promotes pending to curre…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template well. It has an ELI5, a detailed What Changed section, a Why section that explains the alternative (a full Relay refresh was deferred), a Testing section with the …
Full details: Title check

Explanation

The title names the main change: recovering a lost Relay credential rotation so the phone can reconnect without re-pairing. The changeset adds a pending-credential dial path, promotes pending to current on Relay confirmation, and updates refusal guidance, which all match the title. The title uses the conventional fix(mobile) prefix and is concise at 72 characters.

Full details: Description check

Explanation

The description follows the template well. It has an ELI5, a detailed What Changed section, a Why section that explains the alternative (a full Relay refresh was deferred), a Testing section with the regression tests and the unchecked device QA item, a Performance section, a Risk section with level and revert plan, and the checklist. Gaps: the Linked Issue section says 'Related to #47490' but the template expects 'Fixes #' (a closing reference), and the AI Disclosure section is empty. The Visual Proof section is marked N/A with a reason, which is acceptable. The Review section is empty. Overall the description is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8234197e-b0b3-4568-b7da-430a2fc463aa
Commits

Reviewing files that changed from the base of the PR and between e543b34 and 4551e18.

Files selected for processing: 2

  • mobile/src/transport/connection/stable-logical-rpc-client.ts
  • mobile/src/transport/relay/mobile-relay-credential-selection.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Apply a new Retry-After before retaining the gate. · mobile-relay-reconnect-controller.ts:252-253

mobile/src/transport/relay/mobile-relay-reconnect-controller.ts:252-253
Minor · Functional Correctness · Quick win

Apply a new Retry-After before retaining the gate.

After a director 401 enters the new external-signal gate, a gated retry can return a director 503 with a longer Retry-After. Line 252 returns before the delay calculation updates nextAttemptAt. The next reprobe therefore uses the old deadline and can run before the new Retry-After expires.

Update the Retry-After floor before this early return. Preserve the existing gated cadence when the error has no Retry-After.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0df789b9-1439-427a-bc22-5c11829cd2a1
Commits

Reviewing files that changed from the base of the PR and between eb8c09f and 9508860.

Files selected for processing: 29

  • mobile/src/diagnostics/connection-diagnostics-analysis.ts
  • mobile/src/diagnostics/connection-diagnostics-report.ts
  • mobile/src/diagnostics/native-diagnostics-operations.ts
  • mobile/src/host-credentials/mobile-relay-credential-bundle.ts
  • mobile/src/host-credentials/pairing-keychain.ts
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/transport/connection/connection-health.ts
  • mobile/src/transport/connection/logical-client-connection-path.ts
  • mobile/src/transport/connection/mobile-endpoint-credential-rotator.ts
  • mobile/src/transport/connection/mobile-endpoint-nudge-router.ts
  • mobile/src/transport/connection/mobile-endpoint-supervisor-relay-credential.test.ts
  • mobile/src/transport/connection/mobile-endpoint-supervisor.ts
  • mobile/src/transport/relay/mobile-relay-credential-rotation.ts
  • mobile/src/transport/relay/mobile-relay-credential-selection.ts
  • mobile/src/transport/relay/mobile-relay-director-fallback.ts
  • mobile/src/transport/relay/mobile-relay-reconnect-controller.ts
  • mobile/src/transport/relay/mobile-relay-recovery-presentation.ts
  • mobile/src/transport/relay/mobile-relay-session-establisher.ts
  • mobile/src/transport/relay/relay-host-reachability-latch.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b632d46-2169-4c78-9cee-ca2e87b5ef31
Commits

Reviewing files that changed from the base of the PR and between 9508860 and a576b84.

Files selected for processing: 3

  • mobile/src/diagnostics/connection-diagnostics-report.ts
  • mobile/src/transport/connection/mobile-endpoint-nudge-router.ts
  • mobile/src/transport/relay/mobile-relay-reconnect-controller.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-mobile-relay-credential branch from ca222fb to 13a8885 Compare November 26, 2026 11:02
…stop sending every refusal to re-pair

When a phone's credential rotation committed on the relay but the reply was lost,
the phone kept dialing its old token, which the relay refuses once the 24h grace
ends. The phone now dials its saved pending token after the relay refuses current
and grace, and adopts it from the resume confirmation. Refusal advice now says to
connect once on the host's network or re-pair, and Copy report includes the saved
credential's versions, expiries and pending state.
…ion, and ignore repeated network callbacks under the slow gate
…elay candidates once direct wins, bound the report's keychain read
…pair advice for undialable hosts, one report deadline per host
…ay to re-pair if a direct refresh doesn't help
…per attempt, and a trailing retry for throttled network callbacks
…d only a resume or real network move refills it
@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-mobile-relay-credential branch from 13a8885 to 52fdcb4 Compare November 26, 2026 11:16
…gated lease refresh keeps the slow reprobe, and mapped link-local hosts get re-pair advice
…s on it, and a paused pending skips the keychain reread
…ttempt's refusal as verdict evidence, and skips lifts that cannot dial
…covery attempt; drop the speculative retry budget, gated-lift and lease-retry machinery
…ts, so a moved host's pending gets its own lookup; the workspace screen passes the endpoint for link-local advice
…retiring current, refusal advice is computed only for refused hosts, and the eager fence takes main's 13 bytes
…t and retried at the normal backoff; the eager fence takes main's growth
… redial pending, a late lookup after a direct win is dropped, and Home's unreachable projection skips advice
…rect rotation's route is saved; a gated failure keeps the director's Retry-After
@brennanb2025

brennanb2025 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

iOS simulator QA (PR JS at 0dc573c; later commits on this PR don't touch these flows). An iOS simulator was paired with a dev desktop and a Relay server running locally from this repo, with no real account.

Flow Result
Pair, then connect over Relay with the direct path unreachable Pass
Copy report includes Relay credential: current v1 expires …; no grace; pending no, with no tokens or hashes Pass
Desktop quit: Home shows "… is offline", not "Relay refused" Pass
Phone revoked on the desktop: Home shows "Relay refused access" with the new refresh-or-re-pair advice; diagnostics say "Relay refused this device's relay credential (close code 4401)" Pass

Not exercised: the link-local "Re-pair with your desktop" variant (needs a 169.254/fe80 endpoint), and the lost-reply rotation itself (needs fault injection mid-rotation; the regression tests cover it).

Connected over Relay:

(screenshot removed: contained real product data)

Diagnostics while connected:

(screenshot removed: contained real product data)

Desktop offline:

(screenshot removed: contained real product data)

Relay refused after revoke:

(screenshot removed: contained real product data)

(screenshot removed: contained real product data)

…le-relay-credential

# Conflicts:
#	config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs
#	mobile/src/home/home-host-connection-projection.ts
#	mobile/src/host-screen/use-host-screen-controller.ts
#	mobile/src/transport/connection/connection-health.ts
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status: ready for review and merge.

Problem: when a phone's Relay credential rotation was committed but its reply was lost, the phone kept using the old credential and, once Relay refused it, could only recover by re-pairing.

Change: when Relay refuses the current and grace credentials, the phone now tries the saved new credential, and keeps it once Relay confirms it. Refusals of that unconfirmed credential are treated as temporary and retried on the existing slow retry schedule, never marked refused for good. Relay refusal advice now says to connect once on the desktop's network to refresh access, or re-pair (re-pair only for link-local hosts). Desktop-offline is reported separately from a refused credential, and Copy report includes the credential's versions, expiry and pending state, never the credential itself.

Verified: CI is green. Regression tests cover a lost rotation reply recovered over Relay (relay refusal, director refusal, and a desktop that moved Relay cells), a refused unconfirmed credential backing off to the slow schedule, and a director Retry-After respected on gated retries. iOS simulator QA (screenshots above) passed pairing, Relay connect, Copy report, desktop offline and a real refusal.

Deferred: smarter retry pacing for an unconfirmed credential, and refreshing access over Relay itself (listed under Follow-ups in the description).

@brennanb2025

Copy link
Copy Markdown
Contributor Author

End-to-end QA at 647b9b7 (iOS simulator, dev desktops, Relay run locally from this repo, no real account)

The lost-reply bug was reproduced for real, and this PR recovers from it without re-pairing. On main, the same phone stays refused and is told to re-pair.

Flow Result
1. Upgrade: paired on the main build, then the PR build installed over it with the keychain kept Pass. It reconnected over direct, then over Relay with direct cut. There was no pairing prompt. Copy report: current v4 …; grace v3 …; pending no, matching the relay.
2a. Lost reply, grace expired (the bug) Pass. The relay committed v3 and the phone was left with pending yes. With only Relay left, current and grace were each refused (4401), then pending connected. Copy report: current v3; grace v2; pending no, matching the relay. No re-pair.
2b. Lost reply, old token still in grace Pass. The first Relay dial connected and adopted v4.
2c. Control: 2a on the main build Bug reproduced. Main dialed current and grace, got 4401 on both, and never dialed pending. Home showed "Can't connect" and diagnostics said "Re-pair this phone". When the same phone was switched to the PR build, it recovered at once.
3. Revocation stays revoked (revoked while pending yes) Pass. Current and pending were both refused (4401), and the phone never connected in 9.5 minutes. Home showed "Relay refused access … or re-pair". Retries were 61 s, then 141 s, then 219 s (the slow credential schedule), with one dial each.
4. New user (fresh install, paired with direct unreachable) Pass. It connected over Relay. Copy report: current v1; no grace; pending no.
5. Two hosts on one phone Pass. Host B stayed online through host A's lost reply and recovery. B's credential line kept its version, grace and pending values.
6. Downgrade (promoted bundle, main build installed over it) Pass. It connected to both hosts on the first Relay dial, then over direct, and rotated normally. There was no prompt.

Every Copy report was checked for secrets: there were no long base64url strings and no "hash" or "secret". The only "token" matches are the existing "Sending device token" event text.

How the lost reply was injected: a proxy sat between the desktop and the relay. When the relay sent the desktop device-credential-installed (which the relay sends only after the install commits), the proxy first cut the phone's direct path and held back the phone's Relay dials, then forwarded the frame. So the relay committed, and the desktop's reply had no way to reach the phone. The relay's SQLite rows confirmed the commit.

  • Rotation: to get a rotation on demand, the relay ran with a preload that set the credential lifetime to 6 days, so every direct connection rotated.
  • Expiring the 24h grace: the relay's test clock was moved 25 hours ahead for each phone dial only. Moving the whole relay clock detaches the desktops because of the host-proof clock-skew check.

Rig limits:

  • The phone ran a dev client with JS from Metro. "Install over it" means reinstalling the same .app over the existing install without uninstalling, so the keychain stays.
  • The desktop that served the phone ran from main, because main's phone JS needs a newer desktop than this branch's base. This branch is far behind main. This QA tested the PR head as-is, not the PR merged with main.
  • Opening a host showed an "Update Orca" notice on every dev desktop. That is a dev-runner artifact: the web bundle isn't built. Home, Connection log and Copy report were unaffected.
Lost reply: host A unreachable, host B still online Host A recovered over Relay with its saved token
Connection log: two 4401 refusals, then connected Main build, same scenario: stuck
Same stuck phone after upgrading to the PR build Revoked: refusal advice on Home
Revoked: diagnostics New user connected over Relay
Upgrade: PR build over Relay, no re-pair Downgrade: main build over Relay

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; the slow-retry issue is fixed and no new blocking issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the slow-retry issue is fixed and no new blocking issue was found.

Summary

The PR lets the phone recover a lost Relay credential rotation using its saved pending token.

  • Phones can recover a lost Relay rotation using the saved pending credential.
  • Relay retries keep steady connection verdicts visible without repeating updates.
  • Relay refusal advice offers a network refresh before asking most people to re-pair.
  • Copied connection reports show Relay credential versions and expiry dates.

Reviews (3) · Last reviewed commit: "fix(mobile-relay): leave the credential ..." · Reviewed by Greptile

…ial reports host offline

A 4404 means the cell accepted the credential and the desktop is offline, so a
refused pending that commits later retries at the 5-15 s offline cadence instead
of the escalating credential reprobe.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf waiver (Brennan): "Accept; file a follow-up" #49338 — the offline-host retry cadence and log writes are the same as main; a separate follow-up PR handles them.

@brennanb2025
brennanb2025 merged commit b741fd7 into main Nov 30, 2026
29 checks passed
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