fix(updates): select installable asset by priority; show version in About#99
Merged
Conversation
…bout The self-updater picked the wrong release asset on Linux and Windows. platformAssetUrl() iterated over assets and returned the first one matching any listed extension, so for v0.2.1 (which ships both a .tar.gz and a .deb on Linux, and a .zip and setup .exe on Windows) the alphabetically-first package format won — but the installer can only extract .tar.gz/.zip, producing "Unsupported archive: ...deb". Split asset selection into two priority-ordered lists: - _installableExts: formats the in-place swap helper can actually apply (Linux .tar.gz, Windows .zip, macOS .dmg, Android .apk). - _downloadExts: superset including .deb/.rpm/.appimage and setup .exe/.msi as manual-download fallbacks. Selection now iterates extensions (preference) rather than assets, so a release that bundles multiple formats installs the right one and a package-only release falls back to a manual download link instead of failing mid-install. Also bump kAppVersion 0.2.0 -> 0.2.1 to match pubspec, and surface the version in Settings -> About. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
krazyjakee
added a commit
that referenced
this pull request
Jun 16, 2026
* test(updates): guard against re-selecting unextractable .deb for in-place install The self-updater's in-place install can only extract a .tar.gz/.zip, mount a .dmg, or hand off a .apk; package formats (.deb/.rpm/.appimage) and setup installers are download-only. #99 fixed asset selection picking the alphabetically -first .deb over the .tar.gz on Linux ("Unsupported archive: daccord-linux-x86_64.deb") but shipped no test, so the regression silently re-emerged on v0.2.4. Add regression tests over UpdateController's asset selection using the real release asset set (both .deb and .tar.gz, .deb listed first): platformAsset() never returns an unextractable package, always picks the host-applicable extension, prefers .tar.gz over .deb, and a package-only release falls back to a download link instead of failing mid-install. * Fix Windows zip ambiguity in asset selection and test import ordering - _installableExts and _downloadExts for Windows now prefer the more-specific 'windows-x86_64.zip' suffix before the generic '.zip' fallback, preventing daccord-web.zip (which sorts alphabetically before daccord-windows-x86_64.zip in GitHub's asset list) from being selected as the in-place Windows installer — the same class of bug as the .deb-over-.tar.gz regression being guarded here. - Add a Windows regression test mirroring the Linux .deb/.tar.gz test. - Strengthen the 'selects the extension the host installer can apply' assertion on Windows to verify the name contains 'windows', not just that the extension is .zip. - Fix import ordering in the test file: dart: imports before package:. https://claude.ai/code/session_01HPonjbbg1y1GMMTQLKebce --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the self-updater failing with "Unsupported archive: daccord-linux-x86_64.deb" on Linux (and the same latent bug on Windows), plus surfaces the app version in Settings.
Root cause
platformAssetUrl()iterated over the release's assets and returned the first one matching any listed extension. Theextslist encoded an intended priority, but iterating assets ignored it. For v0.2.1 — which ships bothdaccord-linux-x86_64.tar.gzanddaccord-linux-x86_64.deb— the alphabetically-first.debwon. The in-place installer only extracts.tar.gz/.zip, so it threw "Unsupported archive". Windows had the identical problem: it would have selecteddaccord-windows-x86_64-setup.exeover the.zipand failed the same way.Fix
Split asset selection into two priority-ordered lists in
update_controller.dart:_installableExts— only formats the in-place swap helper can actually apply: Linux.tar.gz, Windows.zip, macOS.dmg, Android.apk. Drives the one-click "Download & install" button._downloadExts— superset including.deb/.rpm/.appimage(Linux) and setup.exe/.msi(Windows) as manual-download fallbacks.Selection now iterates extensions (preference) rather than assets, so:
Also
kAppVersion0.2.0→0.2.1to matchpubspec.yaml(it was stale).v<version>in Settings → About.Reviewer notes
.zip. The Inno installer (dist/installer.iss) usesPrivilegesRequired=lowest+{autopf}, so the default install dir is user-writable%LOCALAPPDATA%\Programs\Daccord— themove-based swap works without elevation. (Only a user who manually elevates intoC:\Program Fileshits the same inherent limitation as macOS copying into/Applications.)pubspec.lockwas intentionally left out — localpub getproduced unrelated transitive bumps.Test plan
flutter analyze --no-fatal-infosclean on changed filesflutter test(settings + notifications) pass.tar.gzand installs in placev0.2.1🤖 Generated with Claude Code