Repository navigation
fix(wsl): user clicks on cwd-less gh may start the stopped default distro - #36230
Conversation
…stro #35709 stopped background gh/glab from booting a stopped default distro, which also refused explicit clicks for users whose gh lives only in WSL. Starring Orca, the auth diagnosis, the project picker, opening a work item and board edits now run as a user act on the distro the fallback uses; the board table reload, which also runs unprompted, stays gated. The GitHub and GitLab rate-limit cards keep their last snapshot on the not-running refusal instead of flipping to unavailable.
|
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 7 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 |
…ject gh calls Wrapping the project-view and auth-diagnosis IPC handlers as user acts also let mount effects (useProjectViewTable listing a restored board's views, GhAuthErrorHelp's diagnosis) start a stopped default distro. The handlers now wake only when the renderer passes wakeWslDistro, which the picker browse/select, opening an item and every edit set; mount effects leave it unset, and the auth diagnosis never wakes.
|
STATUS: reworked at 519281b after review of 3c33bcf. Only an explicit click (wakeWslDistro from the click site) may start the distro. Mount effects stay gated, including useProjectViewTable's view list and GhAuthErrorHelp's diagnosis, with a mount-effect test. Local gates and the 42 related test files pass. |
ELI5
#35709 stopped background GitHub and GitLab work from silently starting a stopped WSL distro on Windows. That also blocked explicit clicks for people whose
ghexists only in WSL: starring Orca, the GitHub sign-in diagnosis, picking a project board, opening a board item, or editing one now got a "not running" error, where they used to start WSL and work. Clicks are allowed to start the distro, so this lets them again. It also stops the GitHub and GitLab rate-limit cards from flipping to "unavailable" every time the distro is stopped; they keep the last numbers they had.What Changed
ghonly in WSL and the default distro stopped, these clicks failed with "WSL distro '…' is not running": Star (it silently fell back to the browser), the project picker, opening a work item, and board edits.Mechanism:
wakeWslDistro(WakeWslDistroArg). The main handlers run the call as a user act on the fallback's distro (runAsDefaultWslCliUserAct, which honours the configured override) only when it'strue.useProjectViewTable's mount effect, the board table, and the label, assignee and issue-type lists leave it unset.gh:diagnoseAuthnever wakes, becauseGhAuthErrorHelpcalls it from a mount effect.starOrcaruns as a user act itself. Its only callers are the Star buttons, with no mount-effect caller.useGitHubRateLimitSnapshotanduseGitLabRateLimitSnapshottreatisWslDistroNotRunningRefusal, returned or thrown, as "keep the last data" when there is one, like the checks and status pollers.z.object, so the web client's routed calls, and older hosts, drop it.Why
3c33bcf).Linked Issue
N/A (review follow-up to #35709).
Visual Proof
N/A: no layout change. The rate-limit cards keep showing their last numbers instead of the unavailable line while the distro is stopped.
Testing
github-click-wsl-user-act.test.tswakeWslDistro, and stays gated without it. The table, the label/assignee/issue-type lists andgh:diagnoseAuthnever wake, even when asked.project-view-mount-no-wake.test.tsxuseProjectViewTable's mount effect callslistProjectViewswithoutwakeWslDistro; a picker click passes it.wake(mutation-checked)default-wsl-cli-fallback-gate.test.tsstarOrcawith a stopped default distro and hostghmissing starts WSL and succeeds.code-host-rate-limit-stopped-wsl.test.tsx(GitHub and GitLab)github-work-item-issue-target.test.ts's exact-argument assertions now includewakeWslDistro: truefor edits. The 42 related test files pass (278 tests).pnpm tc,pnpm run typecheck:ci,check:code-quality:changed, the anti-slop oxlint, and ast-grep pass. Run on macOS with the Windows platform simulated.AI Disclosure
Review
Agent skill upstream boundary
Notes
Flag-off: no flag; it affects Windows users whose
ghexists only in WSL when the default distro is stopped.User-risk: low. Those clicks work again by starting the distro, as they did before #35709, and the rate-limit cards stop flickering to "unavailable".
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)