Bug 1294628

Summary: Gnome software cached wrong desktop file (if more than one)
Product: [Fedora] Fedora Reporter: Chieh Yu <welkineins>
Component: gnome-softwareAssignee: Richard Hughes <rhughes>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: klember, rhughes
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-07 17:21:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chieh Yu 2015-12-29 10:50:40 UTC
Description of problem:
I'm testing Synology Cloud Station Drive package.
(you can download from here http://global.download.synology.com/download/Tools/CloudStation/4.0-4062/Fedora/Installer/x86_64/synology-cloud-station-drive-4.0-4062.x86_64.rpm)

After I install rpm through gnome-software, the launch button show up but not effect when I click it.

I found that this package has TWO desktop file, and one is put in /opt/Synology, another one is in /usr/share/applications. packagekit choose first one as launch entry and that is not in /usr/share/applications folder which lead to no such file error.

The problem can be solved by reboot, so I think here must be some data not updated or cache not cleared. I try pkcon refresh force, update-desktop-database, etc, but no one works.

Please help.


Version-Release number of selected component (if applicable):3.18.2 


How reproducible:


Steps to Reproduce:
1. Install synology Cloud Station package

Actual results:
launch button has no effect


Expected results:
launch process 

Additional info:

Comment 1 Chieh Yu 2015-12-30 03:50:29 UTC
From the source code here

https://github.com/GNOME/gnome-software/blob/d8242f36bd9393ced47b881d8ffb8732360ba846/src/plugins/gs-plugin-packagekit-refresh.c#L280


Gnome-software just *guess* app id using a for loop over all files that package installed and find the first desktop as it app id.

In Synology package, there are two desktop file, and the wrong one is used.

The solution in code should we only check desktop file under normal desktop file path. eg. /usr/share/applications or user home directory.

Comment 2 Richard Hughes 2016-01-07 17:17:40 UTC
Why is the desktop file in /usr/ more important than the one in /opt? Why is the package installing a desktop file in /opt anyway? I'm not against fixing this, but I also think it makes sense to fix the package.

Comment 3 Richard Hughes 2016-01-07 17:21:06 UTC
commit b4c4640ef820a95e032b754c91aa1c3db24dd9af
Author: Richard Hughes <richard>
Date:   Thu Jan 7 17:20:01 2016 +0000

    Only match packaged .desktop files in /usr/share/applications
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1294628

Comment 4 Chieh Yu 2016-01-18 01:48:19 UTC
Sorry for the late reply. I won't touch the bug status, but just reply question from Richard. This package use another desktop file to setup up autostart. The file is located in /opt and only link to ~/.config/autostart/ (I'm not so sure about the path) when user want the software autostart. That's why there are two desktop file.

Richard, thanks for helping solve the bug. Thank you.