Repository navigation
fix(wsl): re-read a paired host's refused default base ref, and close the signal race - #35812
Merged
Merged
Conversation
… the signal race A paired host's repo.baseRefDefault now names the stopped distro that refused it. Clients that cannot hear that host's running signal re-ask on window focus and every 30 s while visible, until it answers. Locally, the running listener is attached before the first read, so a signal that lands while main is answering triggers a re-read instead of being lost.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
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. Comment |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryMakes refused default-branch reads recover for paired hosts and closes the local signal race.
|
7 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
#35778 stopped Orca from starting a stopped WSL distro just to show a repo's default branch. It reloads that branch once the distro runs again, but only for repos on this computer. This PR covers a repo on a paired Orca host (another machine you connect to): the client asks again until the host can answer. It also fixes a small timing gap where the "distro is running again" message could be missed.
What Changed
repo.baseRefDefaultread also returns which distro refused (refusedWslDistro, optional).watchRuntimeRepoBaseRefDefaultinruntime-repo-client.ts, which both Settings and Source Control already use.RuntimeRepositoryRefQueries.getDefaultreturns the new field.Why
Re-asking is cheap and safe. The host's check lists running distros at most once a minute, from a shared lease, and never starts one. A new host-to-client push stream would need capability negotiation with older peers, and no existing host status push carries WSL distro state. A bounded re-poll that only runs while a refusal is showing is the smallest change that recovers the value.
Attaching the listener first, and remembering signals that arrive while a read is in flight, closes the race without an extra round trip to main. It can't loop, because each read only re-asks for signals seen during that read.
Flag-off: the gate doesn't change; this only changes when an already-refused value is asked for again.
User-risk: while a paired host's distro stays stopped, a client re-asks every 30 s while the page is visible and on focus. Each re-ask costs the host at most one shared
wsl --list --runningper minute and never starts the distro.Linked Issue
Fixes #
Visual Proof
N/A. No new UI. The existing unknown state is replaced by the real value once the distro runs.
Testing
runtime-repo-base-ref-default-wsl-retry.test.ts:base-ref-default-wsl-gate.test.ts: the runtime read returnsrefusedWslDistrowhen blocked.Local checks:
pnpm tc,typecheck:ci,check:code-quality:changedand anti-slop oxlint pass.Review
Agent skill upstream boundary
Notes
refusedWslDistrois a new optional field in an RPC result. Older clients ignore it and show unknown, as they do today. Params are unchanged.defaultBaseRef, so it's unchanged.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)