Bug 486037 - Application without metadata defaults to license information as proprietary
Summary: Application without metadata defaults to license information as proprietary
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: 6.0.4
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-23 20:53 UTC by Eamonn Rea
Modified: 2024-05-10 01:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.5
Sentry Crash Report:


Attachments
Geany does not display a license, and viewing information shows a Proprietary Software warning (158.79 KB, image/png)
2024-05-05 01:06 UTC, Eamonn Rea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eamonn Rea 2024-04-23 20:53:20 UTC
SUMMARY
When viewing a package that has no metadata (such as viewing system packages on Arch Linux), Discover will sometimes list the license as blank - Fair enough. However, when clicking the question mark to view license information, it will default to listing the application as proprietary.

This may be slightly misleading. Of course if Discover can't fetch some information it can't be expected to display the license, but maybe the behaviour could be changed. For example, the question mark would open a modal that notes the license is unknown (maybe there's already a message for packages with custom/unknown licenses that could be employed here?), or the question mark could be hidden/disabled entirely. If disabled, the question mark could have a tooltip that indicates why the license is hidden.

I'm not a UIX expert so I won't go too much deeper than that, though I think it would be nice if in this scenario the license wasn't listed as proprietary when it is unknown.


STEPS TO REPRODUCE
1. Select a package that Discover fails to find metadata for (such as a package from the Arch repos on Arch Linux, although no need to install it, just view it)
2. On the right, beside the "License" label, click on the question mark
3. Observe notice that package is proprietary, even for non-proprietary software like Geany


OBSERVED RESULT
Discover displays unknown license as Proprietary in the modal that appears when clicking the question mark beside the License label on an application page.


EXPECTED RESULT
Discover should list the license as unknown, or some other behaviour.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.8.7 Linux Zen
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Comment 1 Harald Sitter 2024-05-03 11:48:28 UTC
Which application does this happen with for example?
Comment 2 Eamonn Rea 2024-05-05 01:05:07 UTC
It happens with Geany when listing the package manager release. I'll add an attachment.

I believe there are other examples I found at the time of reporting, but I can only recall Geany, and I have confirmed the issue still exists with Geany. The screenshot I will attach following this comment was taken today.

The Arch Linux packages page does correctly list Geany as having a license: https://archlinux.org/packages/extra/x86_64/geany/

But in the case where Discover cannot pull it, I think it would be good to have some sort of case to handle as fallback.
Comment 3 Eamonn Rea 2024-05-05 01:06:13 UTC
Created attachment 169201 [details]
Geany does not display a license, and viewing information shows a Proprietary Software warning
Comment 4 Harald Sitter 2024-05-06 10:17:28 UTC
Very strange.

Please post the output of 

appstreamcli search geany
appstreamcli dump geany.desktop
pkcon get-details geany
Comment 5 Eamonn Rea 2024-05-06 16:48:18 UTC
The output is quite long, so I'll put a couple of notes I wanted to make here, before the output:
1. Although there are a couple of results, the Geany I am referring to is the IDE
2. The output of `pkcon get-details geany` occurs for every system package I try to view on Discover that is not already installed (since Discover isn't meant to be used to install Arch packages afaik) -- However, *not* all system packages are missing a license. In other words, even though this message will always appear, even packages that display correctly in Discover will also show this, both from the UI and that command.
3. This affects more than just Geany, other examples of packages with missing licenses are OpenTTD, 0 A.D., and Snes9x.
4. Packages missing a license are usually also missing screenshots. Distro packages that do have license information will usually also display screenshots.

**************************************************

$ appstreamcli search geany
Identifier: io.sourceforge.chart_geany.chart-geany [desktop-application]
Name: Chart Geany
Summary: 
  Chart Geany is a free cross platform software solution for market technical analysis, charting
  and a portfolio manager
Bundle: flatpak:app/io.sourceforge.chart_geany.chart-geany/x86_64/stable
Homepage: https://chart-geany.sourceforge.io/
Icon: io.sourceforge.chart_geany.chart-geany.png
---
Identifier: org.gnome.Devhelp.desktop [desktop-application]
Name: Devhelp
Summary: A developer tool for browsing and searching API documentation
Bundle: flatpak:app/org.gnome.Devhelp/x86_64/stable
Homepage: https://wiki.gnome.org/Apps/Devhelp/
Icon: org.gnome.Devhelp.png
---
Identifier: org.gnome.Devhelp.desktop [desktop-application]
Name: Devhelp
Summary: A developer tool for browsing and searching API documentation
Package: devhelp
Homepage: https://wiki.gnome.org/Apps/Devhelp/
Icon: devhelp_org.gnome.Devhelp.png
---
Identifier: org.geany.Geany [desktop-application]
Name: Geany
Summary: A fast and lightweight IDE
Bundle: flatpak:app/org.geany.Geany/x86_64/stable
Homepage: https://geany.org/
Icon: org.geany.Geany.png
---
Identifier: geany.desktop [desktop-application]
Name: Geany
Summary: A fast and lightweight IDE using GTK+
Package: geany
Icon: geany_geany.png

**************************************************

$ appstreamcli dump geany.desktop
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop-application">
  <id>geany.desktop</id>
  <name>Geany</name>
  <summary>A fast and lightweight IDE using GTK+</summary>
  <description>
    <p>Fast and lightweight IDE</p>
  </description>
  <pkgname>geany</pkgname>
  <launchable type="desktop-id">geany.desktop</launchable>
  <icon type="cached" width="48" height="48">geany_geany.png</icon>
  <icon type="cached" width="64" height="64">geany_geany.png</icon>
  <icon type="cached" width="128" height="128">geany_geany.png</icon>
  <icon type="stock">geany</icon>
  <categories>
    <category>Development</category>
    <category>IDE</category>
    <category>TextEditor</category>
  </categories>
  <provides>
    <mediatype>text/plain</mediatype>
    <mediatype>text/x-chdr</mediatype>
    <mediatype>text/x-csrc</mediatype>
    <mediatype>text/x-c++hdr</mediatype>
    <mediatype>text/x-c++src</mediatype>
    <mediatype>text/x-java</mediatype>
    <mediatype>text/x-dsrc</mediatype>
    <mediatype>text/x-pascal</mediatype>
    <mediatype>text/x-perl</mediatype>
    <mediatype>text/x-python</mediatype>
    <mediatype>application/x-php</mediatype>
    <mediatype>application/x-httpd-php3</mediatype>
    <mediatype>application/x-httpd-php4</mediatype>
    <mediatype>application/x-httpd-php5</mediatype>
    <mediatype>application/xml</mediatype>
    <mediatype>text/html</mediatype>
    <mediatype>text/css</mediatype>
    <mediatype>text/x-sql</mediatype>
    <mediatype>text/x-diff</mediatype>
  </provides>
  <keywords>
    <keyword>Text</keyword>
    <keyword>Editor</keyword>
  </keywords>
</component>

**************************************************

$ pkcon get-details geany
Resolving                               [=========================]         
Getting details                         [=========================]         
Finished                                [=========================]         
Fatal error: geany;2.0-1;x86_64;extra: could not find or read package
Comment 6 Harald Sitter 2024-05-07 07:11:17 UTC
Thanks.

The problem appears to be that the package fails to resolve and consequently has an empty (I think) license which then triggers a UI bug.
Comment 7 Bug Janitor Service 2024-05-07 07:32:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/831
Comment 8 Harald Sitter 2024-05-08 09:08:53 UTC
Git commit 5246ef454c5be0b16e3df7e232e4d3b3984435d0 by Harald Sitter.
Committed on 08/05/2024 at 09:06.
Pushed by sitter into branch 'master'.

packagekit: return empty license array when unknown

this was previously made non-empty so it looks like a valid license set.
since then we've grown the ability to actually show unknown licenses as
unknown in the UI, but that requires the license array to actually be
empty. so, make it empty again (:

M  +1    -1    libdiscover/backends/PackageKitBackend/PackageKitResource.cpp

https://invent.kde.org/plasma/discover/-/commit/5246ef454c5be0b16e3df7e232e4d3b3984435d0
Comment 9 Harald Sitter 2024-05-08 14:45:34 UTC
Git commit c531b7eb8c38ae3761256e0a4f4e160913984cbc by Harald Sitter.
Committed on 08/05/2024 at 14:41.
Pushed by sitter into branch 'Plasma/6.0'.

packagekit: return empty license array when unknown

this was previously made non-empty so it looks like a valid license set.
since then we've grown the ability to actually show unknown licenses as
unknown in the UI, but that requires the license array to actually be
empty. so, make it empty again (:


(cherry picked from commit 5246ef454c5be0b16e3df7e232e4d3b3984435d0)

M  +1    -1    libdiscover/backends/PackageKitBackend/PackageKitResource.cpp

https://invent.kde.org/plasma/discover/-/commit/c531b7eb8c38ae3761256e0a4f4e160913984cbc