Bug 388968

Summary: Discover shows version as "Stable" for Flatpak packages even if release information with version numbers is available in AppStream
Product: [Applications] Discover Reporter: Nate Graham <nate>
Component: Flatpak BackendAssignee: Aleix Pol <aleixpol>
Status: VERIFIED FIXED    
Severity: normal CC: codestruct, jgrulich
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nate Graham 2018-01-14 17:03:08 UTC
Discover with the PackageKit, Flatpak, and Snap backends built from source (git master) on KDE Neon

Visual Studio on Flathub includes release information in the AppStream metadata file: https://github.com/flathub/com.visualstudio.code/blob/master/com.visualstudio.code.appdata.xml#L20. Yet its Version is listed as "Stable" rather than showing the actual version number. The issue reproduces with all other Flatpak packages with release information and version numbers. See attached screenshot.

The Snap backend doesn't have the issue, and does show the actual version number.
Comment 1 Gregor Mi 2018-01-14 17:10:44 UTC
After reading your blogpost, Nate, I tried the described Discover features and also noticed that the version is always "stable" for flathub packages.
Comment 2 Nate Graham 2018-01-14 17:14:11 UTC
Looks like FlatpakResource::availableVersion() just returns the branch rather than even looking for a version string. We could *append* the branch, but we need the version too, to yield this:

Version: 1.0.5 (stable)
Comment 3 Aleix Pol 2018-01-15 01:56:09 UTC
Related: https://github.com/ximion/appstream/issues/164
Comment 4 Aleix Pol 2018-01-15 01:57:18 UTC
Git commit 61f520f9cf1da96eeb16345d197f46ebef859eb3 by Aleix Pol.
Committed on 15/01/2018 at 01:53.
Pushed by apol into branch 'master'.

Extract the version number from the AppStream information

M  +10   -5    libdiscover/backends/FlatpakBackend/FlatpakResource.cpp

https://commits.kde.org/discover/61f520f9cf1da96eeb16345d197f46ebef859eb3
Comment 5 Nate Graham 2018-01-15 02:37:07 UTC
Verified!