Repository navigation
fix(updater): package installs (AUR, deb, rpm) are updated outside the app - #1491
Open
ZhuchkaTriplesix wants to merge 1 commit into
Open
ZhuchkaTriplesix wants to merge 1 commit into
ZhuchkaTriplesix wants to merge 1 commit into
Conversation
…e app The AUR, .deb and .rpm packages put the bundle in /opt/querya-desktop, owned by root. The in-app updater treated it as a portable bundle: it downloaded the zip, quit the app and ran a replace script that could not write there, so the update failed and nothing started again (seen going from 0.4.18 to 0.4.19 with the AUR package). - UpdateInstallContext detects the owning package manager (pacman, dpkg, rpm) for /opt/querya-desktop and any bundle folder the user cannot write; both count as managed, so the dialog offers the update command (or the release page) instead of Download. - The zip installer refuses such a target before the app quits. - The replace script checks that the target is writable and, on any failure, logs the reason and starts the app again.
4 tasks
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.
Problem
With the AUR package, Update from 0.4.18 to 0.4.19 downloaded the update, closed the app and nothing started again; a reinstall was needed.
Cause (confirmed on the affected machine)
.deb/.rpm,scripts/linux/build_deb.sh) installs the bundle into/opt/querya-desktop, owned by root, with/usr/bin/querya_desktopas a symlink.Platform.resolvedExecutableresolves to/opt/querya-desktop/querya_desktop.UpdateInstallContext.isManagedPackageonly knew Snap and Flatpak, so the updater treated this as a portable bundle: it downloadedQuerya-Desktop-0.4.19-linux.zip, extracted it, wrote a replace script and quit the app.set -e) could not delete or copy in/opt/querya-desktopand exited before its finalexec, so the app was not restarted. The leftovers were still in/tmp:/tmp/querya-linux-update-3799797.sh(targetDST='/opt/querya-desktop', it removes itself only on success) and the extracted/tmp/querya-update-1791735255359/.Fix
UpdateInstallContext.linuxSystemPackageManager:pacman(an entryquerya-desktop-*in/var/lib/pacman/local),dpkg(/var/lib/dpkg/info/querya-desktop.list) orrpm, only when the running bundle is/opt/querya-desktop, so a portable copy elsewhere is not affected.isLinuxBundleReadOnly: the bundle folder exists and the user cannot write it (a probe file), whoever installed it.isManagedPackagetrue. The update dialog already handles that: no Download, a Copy update command button withyay -Syu querya-desktop,sudo apt update && sudo apt install --only-upgrade querya-desktoporsudo dnf upgrade querya-desktop; for a read-only folder of unknown origin it shows a hint and an Open release page button.[ -w "$DST" ]and, on any failure (not writable,rsync/rm/cpfailing), writes the reason to~/.local/state/querya-update.logand starts the app again instead of exiting.[Unreleased]entry.Checked
sh -n, and I ran it against a fake bundle: with a read-only target it logs the reason and relaunches the old executable; with a writable one it installs and runs the new one and removes itself.Note for 0.4.19 users
The updater that runs is the installed one, so this helps from the release after it: users of the AUR /
.deb/.rpm0.4.19 should still update through their package manager. Worth a line in the next release notes.