Skip to content

fix(desktop): map Linux assets in the update manifest - #3093

Open
yftx293 wants to merge 3 commits into
TencentCloud:developfrom
yftx293:fix/linux-desktop-updates
Open

yftx293 wants to merge 3 commits into
TencentCloud:developfrom
yftx293:fix/linux-desktop-updates

Conversation

@yftx293

@yftx293 yftx293 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

platformAssetKey() returned null for Linux, so selectRelease() always short-circuited and the desktop shell reported "already up to date" even when the manifest had a Linux package. The manifest already publishes linux_x64 / linux_arm assets (beta channel, e.g. Octop-desktop-linux-amd64-1.0.3b7.deb).

Refs #3087 — this covers the client-side detection gap. The issue's remaining points are manifest data / product decisions (see Notes).

Changes

  • desktop/src/main/update/update-coordinator.ts
    • PlatformKey and ChannelRelease.assets now include linux_x64 / linux_arm.
    • platformAssetKey("linux", arch) maps arm64 → linux_arm, everything else → linux_x64.
  • desktop/src/main/update/update-coordinator.test.ts
    • Linux mapping assertions (x64 / arm64) replace the old null assertion; unknown platforms still return null.
    • New selectRelease test picks linux_x64 from a Linux release and returns the .deb asset.
  • CHANGELOG.md: Unreleased → 修复 entry.

The installer already accepts deb (SUPPORTED_KINDS), so no installer change was needed.

Verification

cd desktop/src
node --experimental-strip-types --import ./scripts/register-extensionless-ts.mjs \
  --test main/update/update-coordinator.test.ts
# before: platformAssetKey("linux","x64") -> null (assertion failed)
# after:  12 tests, 12 pass

tsc --noEmit was not run locally (desktop dependencies are not installed in this checkout); the change only widens a string union and adds branches.

Notes

  • The stable channel in the live manifest currently has no Linux assets, so Linux users with "stable only" enabled still need the beta channel until those assets are published; that is manifest data, not the client.
  • The CLI fallback and installer format questions from the issue are separate changes.

@balabommablock-cpu balabommablock-cpu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested: update-coordinator.test.ts 12/12 on this branch; with only update-coordinator.ts put back to main, 1 fails. The mapping looks right.

One thing a Linux user will still hit with default settings. I ran selectRelease with this branch against the shape of today's live /api/downloads (stable v1.0.2 has no linux_* assets, beta v1.0.3b7 has both):

Installed Stable only Page shows Update offered
1.0.1 on (default) up to date, latest v1.0.2 none
1.0.1 off v1.0.3b7 v1.0.3b7
1.0.3b5 on (default) up to date, latest v1.0.2 none
1.0.3b5 off v1.0.3b7 v1.0.3b7

So until stable carries a Linux build, the default still says "up to date", and in the first row it says so next to a newer version number. Not a blocker for this PR, but a small follow-up would make it honest: when the channel head is newer but has no asset for this platform, return something like "No Linux build on Stable yet. Turn off Stable only to get beta builds" instead of up-to-date.

@yftx293

yftx293 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Added in e5077b18: when the channel head is newer than the installed version but carries no usable asset for this platform, the shell now returns noAssetForPlatform and the update panel shows an explanation (turn off "Stable only" to get beta builds) instead of "up to date".

  • channelHeadNeedsPlatformAsset() in update-coordinator.ts, wired through the IPC contract, useUpdateStatus, and DesktopUpdatePanel (i18n added for zh/en).
  • update-coordinator.test.ts: 13 pass; dashboard update tests: 9 pass; tsc -b clean.

The row where stable v1.0.2 is older than an installed 1.0.3b5 still says "up to date" with latest v1.0.2; that is the correct stable-head answer, so the new hint only appears when the head is actually newer.

@balabommablock-cpu balabommablock-cpu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Re-tested cd250336: update-coordinator.test.ts 13/13 pass. The "up to date next to a newer version" case now gets an explanation. Thanks for adding it.

One copy thing from a scratch check: channelHeadNeedsPlatformAsset also returns true when "Stable only" is already off and the beta head has no Linux asset (and when platform is null). The panel then still says "turn off Stable only", which the user already did.

A small fix could be two strings, picked by stableOnly:

  • on: "No Linux build on Stable yet. Turn off Stable only to get beta builds."
  • off: "The newest release has no package for this platform yet. Try again later."

Not a blocker. Happy to re-check if you change it.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants