Skip to content

fix(web): track switch no longer blocked when Local environment is off - #32048

Open
juliusmarminge wants to merge 3 commits into
mainfrom
fix/issue-32018
Open

juliusmarminge wants to merge 3 commits into
mainfrom
fix/issue-32018

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

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

localSwitchBlockReason now 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 case localSwitchBlockReason > does not block an app with Local environment off, which hosts no server fails on main with expected '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.
  • Desktop, Linux: the published 0.1.7 AppImage shell with only its renderer rebuilt (APP_VERSION=0.1.7 vp build in apps/web, repacked into app.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

Before (6577c6b) After (5c9c228) Diff0 DiffT (fuzz 2%)
Before: 1200x900 dark, warning shown and Switch to Nightly disabled After: 1200x900 dark, no warning and Switch to Nightly enabled Diff at zero threshold, 1200x900 dark Diff at 2% fuzz, 1200x900 dark

Same state, 480×720 light (bottom sheet)

Before (6577c6b) After (5c9c228) Diff0 DiffT (fuzz 2%)
Before: 480x720 light, warning shown and Switch to Nightly disabled After: 480x720 light, no warning and Switch to Nightly enabled Diff at zero threshold, 480x720 light Diff at 2% fuzz, 480x720 light

Control, after: Local environment on, the app's own server connected, 1200×900 dark

After: Local environment on, own server connected, Switch to Nightly enabled as before

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:

  • A newly built AppImage. This machine cannot build one, so only the renderer was rebuilt into the 0.1.7 shell.
  • macOS and Windows desktop.
  • Running the switch through to the reinstall.
  • Recordings of open → Cancel → reopen.
  • Other dialog states that the same unblock now reaches: Nightly → Stable, the macOS reopen note, running-thread footers, the skipped-machine list and a large fleet. Their rendering code is unchanged.
  • The driver and seeding scripts are not attached.

AI-assisted; verified with the tests and tools listed above.

juliusmarminge and others added 3 commits November 6, 2026 13:43
…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>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 6, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 768cd92

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.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The track-switch guard now allows switching when the Local environment is disabled. The dialog passes the environment state to the guard, and tests cover disabled and enabled cases.

Changes: Local-environment track switching

Layer / File(s) Summary
Track-switch guard and tests
apps/web/src/components/sidebar/updateEverything.logic.ts, apps/web/src/components/sidebar/updateEverything.logic.test.ts
localSwitchBlockReason accepts a Local-environment flag and returns no block when it is false. Tests cover disabled and enabled cases, including a starting backend.
Dialog passes Local-environment state
apps/web/src/components/settings/UpdateTrackSwitchDialog.tsx
The dialog passes whether the Local environment is enabled to localSwitchBlockReason.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested labels: size:XS

Suggested reviewers: t3dotgg

Merge Risk: Minimal · up to 768cd

The track switch permits an app with Local environment off while retaining the starting-backend block. No actionable merge risk remains beyond normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the main fix.
Description check Passed The description is mostly complete. It covers the problem, change, tests, screenshots, and untested cases. It does not identify the AI model and harness, establish issue triage or approval, or host th…
Linked Issues check Passed [#32018] The dialog passes the Local environment setting to localSwitchBlockReason. The function allows the switch when Local environment is off and keeps the existing check when it is on. Tests cov…
Out of Scope Changes check Passed [#32018] The dialog, logic, and test changes support the requested track-switch fix. No unrelated changes are identified in the whole-PR summary.
Full details: Description check

Explanation

The description is mostly complete. It covers the problem, change, tests, screenshots, and untested cases. It does not identify the AI model and harness, establish issue triage or approval, or host the screenshots on GitHub as requested by the template.

Full details: Linked Issues check

Explanation

[#32018] The dialog passes the Local environment setting to localSwitchBlockReason. The function allows the switch when Local environment is off and keeps the existing check when it is on. Tests cover both the absent server and a backend still starting. Remote database checks are unchanged.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6577c6b and 768cd92.

Files selected for processing: 3

  • apps/web/src/components/settings/UpdateTrackSwitchDialog.tsx
  • apps/web/src/components/sidebar/updateEverything.logic.test.ts
  • apps/web/src/components/sidebar/updateEverything.logic.ts

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

@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed labels Nov 6, 2026
@shivamhwp

Copy link
Copy Markdown
Collaborator

[GPT-6.1][Codex] on behalf of shivam.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop app can't switch to Nightly when Local environment is off

2 participants