Skip to content

fix(desktop): guarantee the update feed resolves the newest release - #6827

Merged
waleedlatif1 merged 1 commit into
stagingfrom
worktree-desktop-update-latest
Aug 18, 2026
Merged

fix(desktop): guarantee the update feed resolves the newest release#6827
waleedlatif1 merged 1 commit into
stagingfrom
worktree-desktop-update-latest

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Desktop shells already jump straight to the newest release of their channel, never one version at a time — this makes that guarantee hold up.
  • The stable channel reads a GitHub release list it shares with web-app releases, SDK tags, and legacy prereleases, but only ever looked at the first 30 entries. Once enough unrelated releases stack on top, the feed 404s and every stable shell silently stops updating. It now walks pages (100/page, up to 5) until one yields a release for the channel, and fails the feed instead of serving an older build when a page can't be read.
  • The update gate's manual "Get the latest version" button opened GitHub's repository-wide latest release, which can be a tag carrying no desktop artifact at all. It now hits a new /api/desktop/update/download redirect that resolves through the same channel selection, so the manual and auto paths always land on the identical build.

Type of Change

  • Bug fix

Testing

  • 4 new feed tests (page walk, short-page stop, unreadable page) + a new download-route suite; verified they fail without the fix by capping the walk at one page
  • bun run type-check, bun run lint, bun run check:audits (29/29) all pass
  • Verified against the live prod feed: serves version: 0.8.4, the newest stable release

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The stable channel reads a GitHub release list it shares with web-app
releases, SDK tags, and legacy prereleases, but only ever looked at the
first 30 entries. Once enough unrelated releases stack on top, the feed
404s and every stable shell silently stops updating.

Walk pages (100 per page, up to 5) until one yields a release for the
channel, and fail the feed rather than serving an older build when a page
cannot be read.

Also point the update gate's manual download at a new
/api/desktop/update/download redirect, which resolves through the same
channel selection. It previously opened GitHub's repository-wide latest
release, which can be a tag carrying no desktop artifact at all.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Building Building Preview Aug 18, 2026 10:32pm

Request Review

@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes affect production desktop update delivery and release selection; mis-resolution could block updates or point users to wrong installers, though behavior is covered by new route and feed tests.

Overview
Fixes stable desktop updates silently stopping when unrelated GitHub releases push desktop builds past the old 30-release window, and aligns the update gate’s manual download with the same channel resolution as electron-updater.

Release resolution now walks GitHub release pages (100 per page, up to 5 pages) via shared resolveLatestRelease until the deployment channel’s newest build is found. If a page cannot be read, the feed fails with 502 instead of serving an older release.

The manifest route (latest-mac.yml) and a new public GET /api/desktop/update/download route both use that resolver; the download endpoint 302 redirects to the preferred installer asset (.dmg, then .zip).

The blocking update gate’s “Get the latest version” action now opens the deployment’s download redirect on https origins (still falls back to GitHub releases/latest on plain http self-hosted).

Reviewed by Cursor Bugbot for commit 24c8850. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes the stable desktop update feed scan paginated GitHub releases and adds a channel-aware manual installer redirect.

  • Resolves the newest channel release across up to five GitHub release pages while failing closed on unreadable pages.
  • Routes the update gate’s manual action through the same channel and release selection used by automatic updates.
  • Adds coverage for pagination, short-page termination, upstream failures, channel isolation, and installer redirects.
  • Updates the API validation baseline for the new public route.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified.

The feed and manual-download paths consistently use the bounded channel resolver, fail closed when a release page is unreadable, and select artifacts compatible with the repository’s current universal macOS packaging.

Important Files Changed

Filename Overview
apps/sim/lib/desktop/update-feed.ts Adds bounded release pagination, shared GitHub URL construction, and installer-asset selection without an identified current defect.
apps/sim/app/api/desktop/update/latest-mac.yml/route.ts Migrates the update manifest route to the paginated resolver and preserves fail-closed handling for upstream errors.
apps/sim/app/api/desktop/update/download/route.ts Adds a public channel-aware redirect to the universal macOS installer selected from the resolved desktop release.
apps/sim/app/_shell/desktop-update-gate.tsx Sends manual updates through the deployment-specific redirect on HTTPS origins while retaining the GitHub fallback for HTTP.
apps/sim/app/api/desktop/update/latest-mac.yml/route.test.ts Covers page walking, short-page termination, and unreadable-page failure behavior.
apps/sim/app/api/desktop/update/download/route.test.ts Covers stable and prerelease redirects, missing releases, and upstream failures.
scripts/check-api-validation-contracts.ts Registers the input-less redirect route and updates the route-count baseline.

Sequence Diagram

sequenceDiagram
  participant Shell as Desktop update gate
  participant Download as Download redirect API
  participant Feed as Update manifest API
  participant Resolver as Channel release resolver
  participant GitHub as GitHub Releases
  Shell->>Download: GET /api/desktop/update/download
  Download->>Resolver: Resolve deployment channel
  Feed->>Resolver: Resolve deployment channel
  loop Up to five pages
    Resolver->>GitHub: List releases (100/page)
    GitHub-->>Resolver: Release candidates
  end
  Resolver-->>Download: Newest matching release
  Download-->>Shell: 302 to installer asset
  Resolver-->>Feed: Newest matching release
  Feed->>GitHub: Fetch latest-mac.yml
  Feed-->>Shell: Channel-specific update manifest
Loading

Reviews (1): Last reviewed commit: "fix(desktop): guarantee the update feed ..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit 1e2572d into staging Aug 18, 2026
29 of 30 checks passed
@waleedlatif1
waleedlatif1 deleted the worktree-desktop-update-latest branch August 18, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant