fix(desktop updates): Linux package installs update via their package manager
CI / Build & Quality Checks (pull_request) Failing after 1m40s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Playwright smoke (e2e) (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 6s
CI / Build & Quality Checks (pull_request) Failing after 1m40s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Playwright smoke (e2e) (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 6s
Reported on CachyOS: "Check for Updates → The update downloaded but couldn't be installed … Permission denied (os error 13) at path /usr/bin/tauri_current_app…". The app was installed from the Arch package; Tauri's Linux updater can only replace an AppImage. With cinny-desktop's new update_install_kind command: - pacman / deb installs: the toast says the update is available and opens Settings → General → App Updates, which shows the package-manager command (`sudo pacman -U …pkg.tar.zst`, or the .deb + `sudo apt install`) with Copy command and Download package — no Install & Restart that can't work. "Copied" only when the clipboard write actually succeeded. - other distros: a link to the downloads page. - Windows, AppImage, and desktop builds without the command: unchanged in-app update. - a native "package-managed" refusal shows the same help. Tests: unit (kinds, commands, refusal detection); in the real client with a simulated desktop bridge: pacman → toast + Settings command/buttons, install never attempted; older desktop → in-app flow as before. Unit 1321, Playwright 26 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
747400ea25
commit
27d659118f
@@ -55,3 +55,35 @@ test('manual download link: Windows gets the installer, others the release page'
|
||||
);
|
||||
assert.equal(manualDownloadUrl('Mozilla/5.0 (X11; Linux x86_64)'), MANUAL_DOWNLOAD_URL.other);
|
||||
});
|
||||
|
||||
test('install kinds: anything unknown keeps the in-app updater', async () => {
|
||||
const { toInstallKind } = await import('./updateErrors');
|
||||
assert.equal(toInstallKind('pacman'), 'pacman');
|
||||
assert.equal(toInstallKind('deb'), 'deb');
|
||||
assert.equal(toInstallKind('manual'), 'manual');
|
||||
assert.equal(toInstallKind('in-app'), 'in-app');
|
||||
assert.equal(toInstallKind(undefined), 'in-app', 'older desktop build without the command');
|
||||
assert.equal(toInstallKind('rpm'), 'in-app');
|
||||
});
|
||||
|
||||
test('package installs get their package manager’s command, not an Install button', async () => {
|
||||
const { packageUpdateHelp, isPackageManagedError } = await import('./updateErrors');
|
||||
const pacman = packageUpdateHelp('pacman')!;
|
||||
assert.equal(
|
||||
pacman.command,
|
||||
'sudo pacman -U https://code.lotusguild.org/LotusGuild/cinny-desktop/releases/download/latest/LotusChat-x86_64.pkg.tar.zst',
|
||||
);
|
||||
assert.match(pacman.url, /LotusChat-x86_64\.pkg\.tar\.zst$/);
|
||||
const deb = packageUpdateHelp('deb')!;
|
||||
assert.match(deb.command!, /sudo apt install \.\/LotusChat-x86_64\.deb$/);
|
||||
assert.equal(packageUpdateHelp('manual')?.command, undefined);
|
||||
assert.equal(packageUpdateHelp('in-app'), undefined);
|
||||
assert.equal(
|
||||
isPackageManagedError('package-managed (pacman): update Lotus Chat with your package manager'),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
isPackageManagedError('Permission denied (os error 13) at path "/usr/bin/tauri_current_app"'),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user