Repository navigation
Conversation
DesktopUpdateStateSchema had no channelBlockedByPolicy key, so encoding the update state for IPC stripped it and the settings dialog told policy-blocked nightly installs to reinstall by hand instead of preparing the switch to stable. Add the optional key to the schema so the flag reaches the renderer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Preserves an existing policy-blocked update flag across IPC so the Stable-switch flow can distinguish it from updates being disabled. The optional schema addition leaves update policy and product defaults unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Wladefant
left a comment
There was a problem hiding this comment.
Independent exact-head desktop update-policy/IPC source review (COMMENT, not approval) — d30de5d8d4f148078d4edf9347cbc74c63261e5b → main@25bf84ab07f53f141c20239c63e383823a9d5ea0.
Reviewed both changed files and the DesktopUpdateActionResultSchema/update-state IPC composition. The managed-policy discriminator was previously available in the service object but omitted from DesktopUpdateStateSchema encoding; adding optional literal true preserves the true signal without changing absent-key compatibility, and the existing policy-held-nightly test now asserts post-serialization survival. No additional demonstrated P1/P2 defect in the bounded two-file change.
Real PR-event CI #42406039378 completed/SUCCESS; the Test job checked out generated merge 3e1f67dc535d95857f36a5d6d4419b847f4666a4 of this source head, with selected DesktopUpdates.test.ts 40/40 and DesktopRemoteUpdates.test.ts 26/26. Browser-install steps marked skipped do not count as acceptance.
Remaining gate is packaged-nightly, opt-in physical Windows/macOS policy application and actual Stable-switch dialog/installer behavior, including old report/no-flag compatibility and not disrupting existing sessions. Source serialization tests do not establish policy-filesystem privileges, updater installation success, installed binary identity or user consent. Original author retains source and release selection; COMMENTED, not APPROVED or merged by this review.
Problem
A nightly desktop app under a managed update policy that rules out nightly (
allowNightly: false) should offer a one-step switch to Stable. The desktop update service marks that state withchannelBlockedByPolicy: true, butDesktopUpdateStateSchemahas no such key. IPC results are encoded through that schema (getUpdateState, and the state inside the check, download and install results), so the flag is dropped before it reaches the renderer.In that state no later update-state push arrives to put it back, so
localUpdaterStaysPutseesenabled: falsewithout the flag. The Stable switch dialog then prepares no local reinstall and says "This app's updates are off here, so reinstall it yourself to switch.", which is false for this app.Change
Add
channelBlockedByPolicy: Schema.optionalKey(Schema.Literal(true))toDesktopUpdateStateSchema, matching theDesktopUpdateStateinterface field added in #27197.The existing test "holds a nightly install until its user switches to stable" in
DesktopUpdates.test.tsnow also encodes the held state throughDesktopUpdateStateSchemaand checks that the flag survives.Compatibility: the key is optional. The IPC runs between the main and renderer processes of one app build.
DesktopUpdateStatusReportreuses this schema for remote update status; older readers ignore the extra key, and newer readers accept reports without it.Scope and approval
This is a focused fix for an obvious bug: the schema was missing a field its interface already declares. It needs no new behavior or settings. I found no issue or PR covering it; #32048, #32027, #27484 and #30804 touch the same dialog or updater for other causes.
Verification
cd apps/desktop && vp test run src/updates/DesktopUpdates.test.ts -t "holds a nightly install until its user switches to stable"mainwith the new assertion: fails atassert.isTrue((yield* encodeUpdateState(held)).channelBlockedByPolicy)(expectedundefinedto be true).node scripts/check-changed.ts 25bf84ab07f53f141c20239c63e383823a9d5ea0: format, lint, knip, typecheck (36 packages) and tests (2 files, 42 passed) all pass.Terminal captures of these runs follow; the checkout path is shortened to
t3code. Before, onmain's schema with the new assertion: the encoded state drops the flag, so the test fails.After, with the fix: the same test passes.
No dialog capture is included. Development builds with an update feed configured report that updates are only available in packaged production builds, so they never reach the policy-blocked state. Reaching it needs a packaged nightly build (on Linux, the AppImage or .deb) with an update feed, plus a machine-wide managed policy file (
/etc/t3code/policy.jsonon Linux) that rules out nightly. I did not build one or install that policy, so the dialog itself is not checked; the captures above show the flag the dialog reads.Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly