GSConnect / gnome-shell-extension-gsconnect

KDE Connect implementation for GNOME
GNU General Public License v2.0
3.15k stars 255 forks source link

Add option to not remove notification from phone when removing it from GNOME's notification center #1709

Open ArtyIF opened 10 months ago

ArtyIF commented 10 months ago

Describe the bug

Currently, when removing the notification from GNOME's notification center, the notification also gets removed on the phone. However, for some apps, it might be undesirable. One such app is Yandex Music, which causes KDE Connect to send a notification when pausing a song:

image

Hiding it causes the song to stop, as well as resetting the current playlist/album. When using Yandex Music's My Vibe feature, it makes it hard to find the song again, as its history isn't very reliable.

Screencast from 2023-11-08 20-24-58.webm

Steps to reproduce

No response

Expected behavior

No response

GSConnect version

56

Installed from

GNOME Extensions website

GNOME Shell version

45.1

Linux distribution/release

Fedora Linux 39 (Workstation Edition)

Paired device(s)

POCO M5s (original firmware, rooted)

KDE Connect app version

1.29.0

Plugin(s)

Notification sync

Support log

No response

Screenshots

No response

Notes

No response

ferdnyc commented 10 months ago

@ArtyIF

Currently, when removing the notification from GNOME's notification center, the notification also gets removed on the phone. However, for some apps, it might be undesirable.

I hope this doesn't come off as dismissive, but have you considered just not mirroring that app's notifications to the desktop?

The KDE Connect Android app offers (in Plugin Settings > Notification Sync) fine-grained control over exactly which app's notifications are synced to each paired device. You can disable syncing of the notifications for any individual app, which (to an extent) is already a form of the setting you're requesting.

Being able to configure dismissal behavior on an app-by-app basis is an interesting idea, but it feels a bit like adding a lot more tedious configuration (of which there's already quite a bit, on both ends of the pairing) for a situation that it might be easier to just work around using existing tools.

What do you think?

ArtyIF commented 10 months ago

Being able to configure dismissal behavior on an app-by-app basis is an interesting idea

I didn't say anything about app-by-app basis.

ferdnyc commented 10 months ago

@ArtyIF Sorry, I took that as implied in "for some apps. it might be undesirable".

ferdnyc commented 10 months ago

@ArtyIF

Is there any chance you could capture a Support Log session showing both the Yandex notification arriving, and it being dismissed? (See the wiki for information on using Generate Support Log.) You'd want to start the capture before the notification is created on the device, and let it run until after the notification has cleared and the player stopped.

I tested with both Samsung Music and SoundCloud, on my phone.

So I'm wondering if Yandex is doing something wrong with its notifications, that can be reported to them as a bug.

...Although, looking at captures of the SoundCloud notification, there's nothing that differentiates it from any other device notification, except for the fact that the "cancel" reply doesn't cause it to do anything stupid like stop playback.

Still, a captured session can't hurt.

Notes

  1. (Although, amusingly, the SoundCloud notification does include a "Play" action. Which, because it's already playing, will actually Pause playback if clicked. And because notification action buttons become inaccessible after the initial pop-up (thanks, GNOME Shell), whether or not the notification persists it's no longer possible to un-pause playback again. ...Except by picking up the device and doing it there, of course.)
ArtyIF commented 10 months ago

Here's the log:

Support log ``` GSConnect: 56 (user) GJS: 17800 Session: wayland OS: Fedora Linux 39 (Workstation Edition) -------------------------------------------------------------------------------- Nov 09 06:57:11 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:11 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:11 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:11 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:12 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:12 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/messageList.js 753]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:12 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:19 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502239518, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "The Pros and Cons of Breathing", "artist": "Fall Out Boy", "nowPlaying": "Fall Out Boy - The Pros and Cons of Breathing", "album": "Take This to Your Grave", "isPlaying": true, "pos": 3220, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": true, "canGoNext": true, "canSeek": true, "volume": 20 } } Nov 09 06:57:21 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502241017, "type": "kdeconnect.notification", "body": { "payloadHash": "0a8ecbe44c24b0ec13a77a7dbbda8604", "actions": [ "Not selected Dislike", "Previous track", "Pause", "Next track", "Not selected Like" ], "id": "0|ru.yandex.music|10501|null|10283", "onlyOnce": true, "isClearable": true, "appName": "Yandex Music", "time": "1699502236749", "silent": false, "ticker": "The Pros and Cons of Breathing: Fall Out Boy", "title": "The Pros and Cons of Breathing", "text": "Fall Out Boy" }, "payloadSize": 20906, "payloadTransferInfo": { "port": 1747 } } Nov 09 06:57:21 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502241044, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "The Pros and Cons of Breathing", "artist": "Fall Out Boy", "nowPlaying": "Fall Out Boy - The Pros and Cons of Breathing", "album": "Take This to Your Grave", "isPlaying": false, "pos": 4698, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": true, "canGoNext": true, "canSeek": true, "volume": 20 } } Nov 09 06:57:21 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502241067, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "The Pros and Cons of Breathing", "artist": "Fall Out Boy", "nowPlaying": "Fall Out Boy - The Pros and Cons of Breathing", "album": "Take This to Your Grave", "isPlaying": false, "pos": 4698, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": true, "canGoNext": true, "canSeek": true, "volume": 20 } } Nov 09 06:57:21 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:21 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:21 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:21 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502241222, "type": "kdeconnect.notification", "body": { "actions": [ "Not selected Dislike", "Previous track", "Pause", "Next track", "Not selected Like" ], "id": "0|ru.yandex.music|10501|null|10283", "onlyOnce": true, "isClearable": true, "appName": "Yandex Music", "time": "1699502241008", "silent": false, "ticker": "The Pros and Cons of Breathing: Fall Out Boy", "title": "The Pros and Cons of Breathing", "text": "Fall Out Boy" } } Nov 09 06:57:21 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502241305, "type": "kdeconnect.notification", "body": { "actions": [ "Not selected Dislike", "Previous track", "Play", "Next track", "Not selected Like" ], "id": "0|ru.yandex.music|10501|null|10283", "onlyOnce": true, "isClearable": true, "appName": "Yandex Music", "time": "1699502241086", "silent": false, "ticker": "The Pros and Cons of Breathing: Fall Out Boy", "title": "The Pros and Cons of Breathing", "text": "Fall Out Boy" } } Nov 09 06:57:22 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699501899099, "type": "kdeconnect.connectivity_report", "body": { "signalStrengths": { "1": { "networkType": "LTE", "signalStrength": 4 } } } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:sendPacket:472]: POCO M5s: { "id": 1699502246048, "type": "kdeconnect.notification.request", "body": { "cancel": "0|ru.yandex.music|10501|null|10283" } } Nov 09 06:57:26 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:26 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:26 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245719, "type": "kdeconnect.notification", "body": { "id": "0|ru.yandex.music|10501|null|10283", "isCancel": true } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245792, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "The Pros and Cons of Breathing", "artist": "Fall Out Boy", "nowPlaying": "Fall Out Boy - The Pros and Cons of Breathing", "album": "Take This to Your Grave", "isPlaying": false, "pos": 0, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": false, "canGoNext": false, "canSeek": false, "volume": 20 } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245810, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "The Pros and Cons of Breathing", "artist": "Fall Out Boy", "nowPlaying": "Fall Out Boy - The Pros and Cons of Breathing", "album": "Take This to Your Grave", "isPlaying": false, "pos": 0, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": false, "canGoNext": false, "canSeek": false, "volume": 20 } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245830, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "", "artist": "", "nowPlaying": "", "album": "", "isPlaying": false, "pos": 0, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": false, "canGoNext": false, "canSeek": false, "volume": 20 } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245836, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "", "artist": "", "nowPlaying": "", "album": "", "isPlaying": false, "pos": 0, "length": 201500, "canPlay": true, "canPause": true, "canGoPrevious": false, "canGoNext": false, "canSeek": false, "volume": 20 } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245847, "type": "kdeconnect.mpris", "body": { "player": "Yandex Music", "title": "", "artist": "", "nowPlaying": "", "album": "", "isPlaying": false, "pos": 0, "length": 201500, "canPlay": false, "canPause": false, "canGoPrevious": false, "canGoNext": false, "canSeek": false, "volume": 20 } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245863, "type": "kdeconnect.mpris", "body": { "playerList": [] } } Nov 09 06:57:26 org.gnome.Shell.Extensions.GSConnect[3181]: [/service/device.js:_readLoop:364]: POCO M5s: { "id": 1699502245863, "type": "kdeconnect.mpris", "body": { "playerList": [] } } Nov 09 06:57:26 gnome-shell[2319]: JS WARNING: [resource:///org/gnome/shell/ui/calendar.js 1037]: Too many arguments to method Clutter.Actor.hide: expected 0, got 1 ```

I think Yandex sends a clearable notification when a song is paused, then removes it and sends a non-clearable one when resuming, which isn't displayed by GSConnect because it's non-clearable, but the old notification isn't removed either.

GittyMac commented 9 months ago

ViMusic also has a similar notification when a song is paused. Dismissing it also stops playback.

ArtyIF commented 9 months ago

I tested KDE Connect on Windows, and it didn't remove the notification from the phone when it was closed. I'm not sure if Windows tells apps when notifications are closed, though.