Skip to content

fix(desktop): keep release notes from managed update mirrors with custom release names - #47131

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-a3f46d9d6c
Dec 2, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-a3f46d9d6c

Conversation

@saphid

@saphid saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

When an administrator points T3 Code at a managed update mirror, an offered update loses its release notes if the mirror's releaseName doesn't contain the version (for example "December rollout"). The title/version check that guards against GitHub's Atom-feed fallback also runs on the generic provider, which reads both fields from the offered version's own manifest.

Deterministic repro on origin/main (63f7006a050d6d6a4f127397403b0604bc65f5f1):

  1. Serve latest-linux.yml from a local HTTP server:
    version: 1.2.4
    releaseName: December rollout
    releaseNotes: "- Fix startup"
    files:
      - url: T3-Code-1.2.4-x86_64.AppImage
        sha512: AAAA
        size: 1
  2. Set the desktop update policy's feedUrl to that server and check for updates from an older stable build (1.2.3).
  3. Path: DesktopUpdates calls setFeedURL({ provider: "generic", url: policy.feedUrl }). electron-updater's GenericProvider returns { version: "1.2.4", releaseName: "December rollout", releaseNotes: "- Fix startup" }. The update-available handler passes it through releaseNotesOfOfferedVersion, which drops the notes because the name doesn't contain 1.2.4.
  • Observed: the update popover offers 1.2.4 with no notes ({ releaseNotes: [], omittedReleaseCount: 0 }).
  • Expected: 1.2.4 is offered with Fix startup.

Change

When the policy configures a mirror (policy.feedUrl), the update-available handler now uses the manifest's releaseNotes directly. The GitHub feed keeps the existing release-name check, so stale notes from the wrong release are still hidden. This is shared code for the Electron updater on Windows, macOS and Linux. It doesn't touch web, mobile or the server.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • New case DesktopUpdates under a managed policy > shows the mirror's notes for a release name without its version in apps/desktop/src/updates/DesktopUpdates.test.ts:
    • base: AssertionError: expected [] to deeply equal [ { version: '1.2.4', … } ]
    • head: passes. The whole file passes (57/57), including the existing stale-GitHub-notes cases.
  • vp run check:changed exited 0 (format, lint, knip, typecheck, tests).
  • Runtime transcript: the real electron-updater GenericProvider fetches a local latest-linux.yml, and its result goes through main's and head's notes path: https://gist.github.com/saphid/7d56a7e16164931d48bd64d12a6a4805

Not shown: a packaged-app check or download/install against a real mirror, and screenshots of the update popover (the popover renders releaseNotes from state unchanged).

Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).

Not shown

  • apps/web/src/components/sidebar/SidebarUpdatePill.tsx:559 — No packaged-app before/after was captured. Clarify in the repro that base shows the ordinary update tooltip without a notes popover, and head opens the notes popover with ‘Fix startup’.
  • apps/desktop/src/updates/DesktopUpdates.test.ts:1464 — The GenericProvider transcript and regression test are reproducible evidence, but no automated scenarios:prove fixture was run; keep that distinction explicit in Not shown.
  • scripts/check-changed.ts:328 — The supplied summary reports a passing check:changed on head, but the linked transcript does not include SHA-stamped command output and the read-only review did not independently rerun it.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bcd3d0c

Macroscope's review found this PR approvable — Managed update mirrors retain release notes even when their custom release names do not contain the version. Existing normalization remains in place, and update selection and installation behavior are unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bcd3d0c and e6f15db.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

When an administrator configures policy.feedUrl, the update handler uses release notes from the updater event. Otherwise, it continues to load notes from the offered version’s manifest. A test checks the managed-feed update state and parsed notes.

Changes: Managed update release notes

Layer / File(s) Summary
Select and verify release notes
apps/desktop/src/updates/DesktopUpdates.ts, apps/desktop/src/updates/DesktopUpdates.test.ts
When policy.feedUrl is defined, the handler uses info.releaseNotes. A test verifies the offered version and parsed note for a managed-feed update.

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

Change: Bug fix

Suggested reviewers: only21mil

Merge Risk: Low · previous review bcd3d

Managed-mirror update notes now show up when the release name lacks the version. The only open point is a minor test-timing concern, so the change is mergeable with owner awareness.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the desktop component and the specific fix: release notes from managed update mirrors that use custom release names. The change adds a mirror-specific path in the update-available hand…
Description check Passed The description follows the template's main sections: Problem, Change, Scope, and Verification. It gives a deterministic reproduction, a clear explanation of the cause, the test name and base/head res…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the desktop component and the specific fix: release notes from managed update mirrors that use custom release names. The change adds a mirror-specific path in the update-available handler that uses the manifest's releaseNotes when policy.feedUrl is set. The title is specific and matches the changeset. It is slightly long at 86 characters, but it stays within a readable scope.

Full details: Description check

Explanation

The description follows the template's main sections: Problem, Change, Scope, and Verification. It gives a deterministic reproduction, a clear explanation of the cause, the test name and base/head results, and the scope rationale. It also lists what was not shown. The Problem section states expected and observed behavior. The Verification section names the focused test and the results. The template's agent-attribution line is present as an authored-by note. The description contains a stray review-generated 'Not shown' block with three findings that read as bot-written notes, and it does not give a commit SHA-stamped check output. These gaps are non-critical, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

apps/desktop/src/updates/DesktopUpdates.test.ts-1479-1479: 1

1479-1479: Minor · Stability & Availability · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Wait for the update state publication.

flushCallbacks is Effect.yieldNow; it does not guarantee that the handler has published its state. If the handler suspends, the assertion can read the previous state. Subscribe before emitting and await the publication, as nextPublishedState does elsewhere in this file. (raw.githubusercontent.com)

As per coding guidelines, tests must “await the specific persisted event or Deferred that marks the milestone.”

Source: Coding guidelines

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e9143bf and bcd3d0c.

Files selected for processing: 2

  • apps/desktop/src/updates/DesktopUpdates.test.ts
  • apps/desktop/src/updates/DesktopUpdates.ts

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

@saphid

saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @coderabbitai. On the unverified DesktopUpdates.test.ts:1479 note (flushCallbacks vs nextPublishedState): this test uses the same emit → flushCallbacks → getState pattern as the other update-available tests in this file. With a managed feedUrl, the handler reads info.releaseNotes directly and does no manifest I/O before it publishes, so it has no suspension point that would leave getState stale. The test passes consistently, so I'm leaving it as is to keep this PR small. Happy to switch it to nextPublishedState if a maintainer would like that.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -u
for f in apps/desktop/src/updates/DesktopUpdates.test.ts apps/desktop/src/updates/DesktopUpdates.ts; do
  echo "=== OUTLINE $f ==="
  ast-grep outline "$f" --items all --match 'flushCallbacks|nextPublishedState|handleUpdateAvailable|DesktopUpdates'
  echo "=== MATCHES $f ==="
  rg -n -C 3 'flushCallbacks|nextPublishedState|handleUpdateAvailable|mirror.s notes for a release name|update-available|feedUrl' "$f" | head -300
done
echo "=== TEST WINDOW ==="
cat -n apps/desktop/src/updates/DesktopUpdates.test.ts | sed -n '1430,1510p'
echo "=== GUIDANCE FILES ==="
for f in AGENTS.md apps/AGENTS.md apps/desktop/AGENTS.md apps/desktop/src/AGENTS.md apps/desktop/src/updates/AGENTS.md; do
  if [ -f "$f" ]; then
    echo "=== $f ==="
    cat "$f"
  fi
done

Length of output: 38413


Script executed:

#!/bin/bash
set -u
echo "=== HANDLER ==="
cat -n apps/desktop/src/updates/DesktopUpdates.ts | sed -n '1100,1190p'
echo "=== PUBLISH AND EVENT DISPATCH ==="
rg -n -C 4 'const (publish|runEffect|currentIsoTimestamp)|function (publish|runEffect)|publishState|runEffect\(' apps/desktop/src/updates/DesktopUpdates.ts
echo "=== TEST HELPER ==="
cat -n apps/desktop/src/updates/DesktopUpdates.test.ts | sed -n '65,105p'
echo "=== HARNESS OUTLINE ==="
ast-grep outline apps/desktop/src/updates/updatesTestHarness.ts --items all --match 'flushCallbacks|emit|makeHarness'
rg -n -C 5 'flushCallbacks|emit\s*[:=(]|runEffect' apps/desktop/src/updates/updatesTestHarness.ts
echo "=== TESTING GUIDANCE ==="
rg -n -C 5 'async|yield|drain|scheduler|published|sleeps|polling' docs/internals/15_testing.md | head -180

Length of output: 13305


Script executed:

#!/bin/bash
set -u
rg -n -C 5 '\b(offerable|setState|updateStateRef|decodeUpdateInfo)\b' apps/desktop/src/updates/DesktopUpdates.ts | head -240
echo "=== DEFINITIONS ==="
for name in offerable setState; do
  line=$(rg -n "const $name\\b" apps/desktop/src/updates/DesktopUpdates.ts | head -1 | cut -d: -f1)
  if [ -n "$line" ]; then
    start=$((line > 12 ? line - 12 : 1))
    end=$((line + 55))
    cat -n apps/desktop/src/updates/DesktopUpdates.ts | sed -n "${start},${end}p"
  fi
done

Length of output: 17182


@saphid Thanks for the explanation. The managed-feed path reads the event’s notes without manifest I/O, and the test follows the existing pattern. I withdraw the timing concern for this test; a switch to nextPublishedState is not needed.

I inspected the code but did not rerun the test.


📝 Learnings were not changed: only organization members or users with write access to this repository can add or remove learnings.

You are interacting with an AI system.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 2, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

On each commit, built a production Linux x64 AppImage with version 1.2.3. Served latest-linux.yml over HTTPS at 127.0.0.1:8443 offering version 1.2.4, releaseName 'December rollout', releaseNotes '- Fix startup', and the reported AppImage files entry (sha512 AAAA, size 1). Installed the reported Example Corp auto-update policy with that feedUrl. Launched with fresh T3 and XDG state, allowed the local self-signed certificate identically on both sides, waited for the automatic update offer, clicked Start, and hovered the sidebar update control. Captured the same hover interaction and stable screenshots (two identical screenshots 500 ms apart).

Environment for both captures: real Linux x64 production AppImage, light theme, fresh empty state, 1100×780 app viewport under Xvfb. Recordings show the same hover and are cropped to the app window.

Before After
2b2bc06316 e6f15db2ce
Before: update tooltip without release notes After: release-notes popover with Fix startup
Before hover recording After hover recording

Base offered 1.2.4 with releaseNotes: [], logged releaseNoteGroups: 0, and had no release-notes popover. Head offered the same version with one note group, logged releaseNoteGroups: 1, and displayed “What's changed” / “Fix startup.”

Driver · HTTPS mirror · Policy · Base app log (local paths redacted) · Head app log (local paths redacted)

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 2, 2026
@juliusmarminge
juliusmarminge merged commit 909eeee into pingdotgg:main Dec 2, 2026
58 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants