Gnome notifications on `core24` with `gnome` extension

Hi all

Writing to highlight an issue I’ve come across in the past few days when migrating mattermost-desktop and discord to core24. It would appear that notifications are not working as expected after the transition - something I expect will require a change in either the gnome extension, or the interfaces automatically added by it.

Examples below from some Github issues - note the Unknown App header, and incorrect escaping of special characters:

355457497-e0bc9a14-dc96-4b50-a949-edac21b3acd0

354800369-803a3744-1afb-4b23-b08b-58cd9b2a37dd

Some more background in the following issues:

Would be interested if anybody else has seen this, or knows of a workaround?

Cheers, Jon

1 Like

images not loading :confused:

Fixed, sorry about that!

As I said there also, this seems to be snapd issue. Are these happening in between some updates?

EDIT: my guess is, as the revision changes, snapd isn’t probably taking the new revision for the app into account. Thus the shell cannot recognize the app anymore.

It seems likely that the libraries in the newer gnome platform snap are structuring the notification differently than the core22 platform snap.

It would be useful to see how the D-Bus messages differ. This could be done by running the following command:

dbus-monitor --session interface=org.freedesktop.Notifications,member=Notify interface=org.gtk.Notifications,member=AddNotification

… and then do whatever is necessary to trigger the notification. If we could get a paste of the method calls for the notification from the core22 and core24 versions of the snap, that would help diagnose what’s going on.

Sure, good idea:

The core24 output was very small. Whereas the core22 output was much bigger.

Let me know if I can grab anything else.

In fact I just realised that the full dump didn’t fit in that Gist - I’e uploaded it using wormhole here: https://wormhole.app/6LKWO#EFFcLJgdAYY--tpIuMaH1g

libnotify4 was changed to use XDG Desktop Portal for notifications in 0.8.0 (included in core24).

Workaround until the new path is fixed: NOTIFY_IGNORE_PORTAL=1 in the environment

2 Likes

Great work tracking this down. We should put this into GitHub - snapcore/snapcraft-desktop-integration: Desktop integration helpers so that existing snaps will benefit once the platform snap is rebuilt.

Longer term, we should work through what’s necessary to get the xdg-desktop-portal notification API to work correctly with snaps (which probably requires custom desktop ID support in snapd to function).

2 Likes

Thanks, I’ll give that a try on affected snaps!

I tested this locally and it worked a treat! Thank you.

I’ve filed Desktop notifications on `core24` · Issue #28 · snapcore/snapcraft-desktop-integration · GitHub for now.

@jamesh are you able to coord with snapd and ensure an appropriate issue is filed? I think you’ve got better context than me, though I’m happy to help where I can!

1 Like

The fix is in the latest/candidate channel of the gnome-46-2404 snap.

I’ve verified it works by reverting mattermost-desktop to the previous build 758.

1 Like