Repository navigation
fix(web): track switch no longer blocked when Local environment is off - #32048
juliusmarminge wants to merge 3 commits into
Conversation
…nt off An app with Local environment off hosts no server, so crossing tracks should not wait on a database check. With Local environment on, a primary backend that is still starting stays blocked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Local environment off the desktop app hosts no server, but the track switch dialog still refused with "its server is not connected, so its database cannot be checked". The reinstall restarts no server then, so skip the local database check. Local environment on with no server yet (the primary backend still starting) stays blocked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ith Local environment off Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Track switching is no longer blocked by local database checks when Local environment is disabled and no local backend runs. Database safeguards remain unchanged when Local environment is enabled. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Issue watch picked up #32018 after this PR was already open. At main d5fc29f, the guard still rejects an empty hosted-server list. We found this PR before implementing or launching a desktop reproduction, so there are no independent runtime results to add. Handing the issue back to this PR and stopping our duplicate work. |
Problem
With Local environment off, the desktop app hosts no server, but Settings → About → Update track → Nightly still blocked the switch with "This app cannot switch: its server is not connected, so its database cannot be checked." There is no database for this app to check, so the only way past the block was to turn Local environment on and start a second server.
Reproduced on the published 0.1.7 Stable Linux AppImage, with Local environment off and a separately run T3 server (from main, 6577c6b) paired under Settings → Environments. Choosing Nightly (
0.1.8-nightly.20261106.4262) showed the block, with "Switch to Nightly" disabled. With Local environment on and the app's own server connected, the same dialog allowed the switch.Change
localSwitchBlockReasonnow also gets whether Local environment is on, and returns no block when it is off: this app's reinstall then restarts no server of its own. The dialog passes!isLocalEnvironmentDisabled().It keys on the setting rather than on "no hosted servers and no desktop backends". That count is also zero while Local environment is on and the app's backend is still starting: the client registers that backend only after it answers, and the desktop leaves it out of its backend list until then. That case stays blocked. Remote servers' database checks are unchanged.
Scope and approval
Fixes #32018
Verification
vp test run apps/web/src/components/sidebar/updateEverything.logic.test.ts: 10 passed. The new caselocalSwitchBlockReason > does not block an app with Local environment off, which hosts no serverfails on main withexpected 'its server is not connected, so its database cannot be checked' to be null. Its second assertion keeps the case where Local environment is on and the backend has not appeared yet blocked.vp run check:changed: passed.APP_VERSION=0.1.7 vp buildinapps/web, repacked intoapp.asar), once from the merge-base and once from this branch. Isolated profile, Local environment off, one remote environment paired and connected. Same server, release and steps on both sides. Electron 44 under Xvfb, DPR 1, no device emulation,prefers-reduced-motion: reduce, frozen clock. Steps: open About, choose Update track → Nightly, wait for the dialog to settle. "Switch to Nightly" was not clicked.Local environment off, Stable → Nightly, remote connected, 1200×900 dark
Same state, 480×720 light (bottom sheet)
Control, after: Local environment on, the app's own server connected, 1200×900 dark
What else changed: the dialog is shorter by the removed warning, so its content shifts down and the button takes its enabled colour. The Environments and About pages before the dialog opens are identical at zero threshold. Nothing else differs.
The captures were made at 5c9c228. The head commit after it changes only a doc comment.
Not checked:
AI-assisted; verified with the tests and tools listed above.