Starting snap from the after-install notification fails

Bug #1816396 reported by Sebastien Bacher on 2019-02-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-software (Ubuntu)
Medium
Robert Ancell
Bionic
Medium
Robert Ancell
Cosmic
Medium
Robert Ancell
Disco
Medium
Robert Ancell

Bug Description

[Impact]
The launch button on the notification shown after snaps are installed doesn't work.

[Test Case]
1. Open GNOME Software
2. Select a snap that is not installed
3. Install that snap
4. Switch focus to another application (i.e. so GNOME Software doesn't have focus)

Expected result:
A notification is shown saying the app is installed with a button that launches it.

Observed result:
A notification is shown but the launch button give an error like "no such desktop file: io.snapcraft.vlc-...."

[Regression Potential]
TBD

Changed in gnome-software (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Ken VanDine (ken-vandine) wrote :

I'm seeing the same behavior on cosmic, so not specific to disco.

Feb 18 14:28:23 x230 gnome-software[4674]: no such desktop file: io.snapcraft.vlc-RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd

Changed in gnome-software (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
Changed in gnome-software (Ubuntu Cosmic):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Robert Ancell (robert-ancell)
summary: - [Disco] starting snap from the after-install notification fails
+ Starting snap from the after-install notification fails
Changed in gnome-software (Ubuntu Bionic):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Robert Ancell (robert-ancell)
Changed in gnome-software (Ubuntu):
status: Confirmed → Triaged
Changed in gnome-software (Ubuntu Bionic):
status: Confirmed → Triaged
Changed in gnome-software (Ubuntu Cosmic):
status: Confirmed → Triaged
description: updated
Sebastien Bacher (seb128) wrote :

Not going to be SRUed to cosmic which is neither nor a LTS nor the current stable version

Changed in gnome-software (Ubuntu Cosmic):
status: Triaged → Won't Fix
Changed in gnome-software (Ubuntu Disco):
assignee: nobody → Robert Ancell (robert-ancell)
importance: Undecided → Medium
status: New → Triaged
Robert Ancell (robert-ancell) wrote :

The cause of this is:
1. You install a snap.
2. GNOME Software generates a notification, with a button that will contact the GNOME Software process and perform the action "app.launch" with the app ID. (gs-common.c:gs_app_notify_installed)
3. GNOME Software uses the ID as a desktop ID (i.e. the name of a .desktop file) to launch the application via the GAppInfo object (gs-application.c:launch_activated)

Where this fails is G-S is assuming that the application ID matches the desktop ID. This is best practise for modern XDG compliant apps, but is not enforced.

This assumption always fails in the general case for Snaps, and the ID used is a generated AppStream ID like io.snapcraft.moon-buggy-2kkitQurgOkL3foImG4wDwn9CIANuHlt.

The initial solution was to explicitly pass the desktop ID, but this seemed a bit of a hack an unlikely to be upstreamable. https://gitlab.gnome.org/robert.ancell/gnome-software/tree/notification-launch-desktop-id

The second solution was to continue to pass the ID, but instead to have plugins do the launching, that way the Snap plugin could work out the binary to run. https://gitlab.gnome.org/robert.ancell/gnome-software/tree/notification-launch-plugin

The latter solution turns out to be non-trivial to implement.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.