Repository navigation
fix(desktop): a failed update-track save keeps offering the current track's updates - #34917
Conversation
…ffers Reproduces #34876: setChannel sets the release floor before the settings write, so a rejected save leaves the requested track's floor in place and the unchanged track's newer releases are filtered out. AI-assisted; verified with the tests and tools listed above.
…rack's updates Restore the previous release floor when persisting the new update channel fails, so later checks on the unchanged track are not filtered by the requested track's minimum version. Fixes #34876 AI-assisted; verified with the tests and tools listed above.
There was a problem hiding this comment.
All clear
Posted via Macroscope — Effect Service Conventions
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — A failed update-channel save now restores the previous release floor, preserving offers from the current track. Successful channel changes and product defaults remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
DesktopUpdates.setChannel set releaseFloorRef to the requested track's minimumVersion before desktopSettings.setUpdateChannel ran, and nothing restored it when the save failed. The
offerablefilter then kept applying the other track's floor on the unchanged track, so valid updates there were dropped and the state read up-to-date. The fix uses Ref.getAndSet to remember the previous floor and adds Effect.onError on the settings save to restore it before the error is mapped to DesktopUpdateChannelPersistenceError. The success path and the same-track early return are unchanged. No new regex or parser.Fixes #34876
Reproduction on main
On origin/main 4e0b528, I added a test to apps/desktop/src/updates/DesktopUpdates.test.ts using the existing updates harness. The packaged Stable 1.2.3 build has a settings write that fails with DesktopSettingsWriteError. The test calls updates.setChannel('nightly', { minimumVersion: '1.2.5-nightly.20261028.1' }), which rejects with DesktopUpdateChannelPersistenceError, and the state channel stays 'latest'. The updater then emits update-available 1.2.4. Ran
vp test run apps/desktop/src/updates/DesktopUpdates.test.ts: the new test fails withexpected null to equal '1.2.4'(availableVersion stays null) and the other 44 tests pass. This is a service-level reproduction with Electron and settings faked; no packaged UI session was run.Evidence
In the packaged Linux Electron app, start on Stable 1.2.3. Force the real settings write to fail, then request Nightly with minimum version
1.2.5-nightly.20261028.1through desktop IPC. The request rejects and the track remains Stable. Offer Stable 1.2.4 from a local HTTP feed and click Check for Updates.Both sides use fresh synthetic homes, the same driver, light theme, and a 1100×780 window. Captures show the About update controls.
Reproduction driver · Packaging script · Reproduction instructions
AI-assisted; verified with the tests and tools listed above.
Not shown:
Tests
Without the fix,
vp test run apps/desktop/src/updates/DesktopUpdates.test.tsfails the repro test 'keeps the current track's offers when a track switch fails to save' withexpected null to equal '1.2.4'. With the fix, all 45 tests pass, before and after formatting.vp run check:changed: lint, knip 1/2 and 2/2, typecheck (2 packages) and test (1 file) passed; format failed on the first run. Aftervp format,vp format --checkon both changed files passed. The fullcheck:changedwas not re-run after formatting; the commit hooks (fmt, lint, knip) passed.AI-assisted; verified with the tests and tools listed above.