hughsie / appstream-glib

This library provides objects and helper methods to help reading and writing AppStream metadata.
GNU Lesser General Public License v2.1
65 stars 103 forks source link

<suggests><id/></suggests> causes criticals but is not diagnosed as invalid #396

Closed smcv closed 3 years ago

smcv commented 3 years ago

To reproduce

Build flathub/org.cubocore.CoreImage@0f341fdb (or just parse its appdata.xml, probably)

Expected result

No critical warnings. Validation fails, because suggesting an app with an empty ID makes no sense.

Actual result

flatpak run org.freedesktop.appstream-glib validate builddir/*/share/appdata/org.cubocore.CoreImage.appdata.xml
 in dir /srv/buildbot/worker/build-x86_64-7/build (timeout 1200 secs)
 watching logfiles {}
 argv: b'flatpak run org.freedesktop.appstream-glib validate builddir/*/share/appdata/org.cubocore.CoreImage.appdata.xml'
 using PTY: False
(appstream-util:2): As-CRITICAL **: 14:48:55.308: as_ref_string_new: assertion 'str != NULL' failed
builddir/files/share/appdata/org.cubocore.CoreImage.appdata.xml: OK
(appstream-util:2): As-CRITICAL **: 14:48:55.577: as_ref_string_unref: assertion 'rstr != NULL' failed
program finished with exit code 0
elapsedTime=0.372254

and when the invalid appdata gets merged with the appdata from the rest of Flathub's apps, it causes Flatpak clients to show those same critical warnings (flatpak/flatpak#4219).