Skip to content

Don't attempt to format the installed version string in the form of "version (branch)" if there is no version in the Flatpak's appdata

Previously in master (and currently in 5.24) Discover shows some Flatpak updates in the form of " (xxx) -> xxx" despite both sides looking the same minus the parentheses (for example updates to the KDE Flatpak runtime updates look like " (5.15-21.08) -> 5.15-21.08").

This is because affected Flatpaks do not have a version field in the metadata/appdata (this can be checked via flatpak info), so availableVersion() returns just "branch" correctly, but installedVersion() assumes the version field isn't empty and returns " (branch)" instead, thus the UI thinks they're different and tries to show the version change.

After applying this patch on top of 5.24.4 on my system KDE Flatpak runtime updates now look like "Update to version 5.15-21.08", like other Flatpaks if their version number doesn't change.

Before: discover-before

After: discover-after

(cherry picked from commit c2f751eb)

BUG: 447937

Edited by Prajna Sariputra

Merge request reports