GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
551 stars 59 forks source link

[Bug]: Muted notifications does not work #685

Open danialbehzadi opened 9 months ago

danialbehzadi commented 9 months ago

Describe the bug

As discussed in #684, muting a notification type in preferences, does nothing.

If you disable "Favourites" from push notifications and close Tuba (using the X button, not killing it), what's the output of gsettings get dev.geopjr.Tuba muted-notification-types?

[📦 dev.geopjr.Tuba ~]$ gsettings get dev.geopjr.Tuba muted-notification-types
@as []

Are you sure you received a "favourite" notification and not maybe a mention?

Yes. Tested multiple times

Steps To Reproduce

  1. go to preferences > notifications.
  2. turn favorites switch off.
  3. close the window.
  4. wait for someone favorite your post.
  5. there will be a notification.

Logs and/or Screenshots

$ G_MESSAGES_DEBUG=Tuba flatpak run dev.geopjr.Tuba

(/usr/bin/flatpak.real run:709275): GLib-GIO-CRITICAL **: 02:52:27.770: GFileInfo created without standard::is-symlink

(/usr/bin/flatpak.real run:709275): GLib-GIO-CRITICAL **: 02:52:27.770: file ../../../gio/gfileinfo.c: line 1677 (g_file_info_get_is_symlink): should not be reached
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: os: GNOME 45 (Flatpak runtime)
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: prefix: /app
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: flatpak: true
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: version: 0.5.0 (production)
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: gtk: 4.12.3 (4.12.1)
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: libadwaita: 1.4.0 (1.4.0)
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: libsoup: 3.4.3 (3.4.3)
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.237: Application.vala:186: libgtksourceview: 5.10.0 (5.10.0)
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.241: SecretAccountStore.vala:9: Using libsecret v0.21.0
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: Network.vala:34: GET: https://persadon.com/api/v1/accounts/22975
Tuba-INFO: 02:52:28.298: Streams.vala:86: TubaMastodonAccount > https://persadon.com/api/v1/streaming/?stream=user:notification
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: Streams.vala:69: Opening stream: https://persadon.com/api/v1/streaming/?stream=user:notification
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: Network.vala:34: GET: https://persadon.com/api/v1/markers?timeline[]=notifications
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: SecretAccountStore.vala:94: Loaded 1 accounts
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: AccountStore.vala:83: Activating @danialbehzadi@persadon.com…
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: AbstractCache.vala:100: Clearing cache
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: Network.vala:34: GET: https://persadon.com/api/v1/accounts/verify_credentials
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: Network.vala:34: GET: https://persadon.com/api/v1/instance
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.298: Network.vala:34: GET: https://persadon.com/api/v1/custom_emojis
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.299: Application.vala:273: Presenting MainWindow
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.310: Network.vala:34: GET: https://cdn.masto.host/persadon/accounts/avatars/000/022/975/original/c5891408ee875418.png
Tuba-INFO: 02:52:28.362: Streams.vala:86: TubaViewsHome > https://persadon.com/api/v1/streaming/?stream=user
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.362: Streams.vala:69: Opening stream: https://persadon.com/api/v1/streaming/?stream=user
Tuba-INFO: 02:52:28.363: Streams.vala:92: TubaViewsHome X https://persadon.com/api/v1/streaming/?stream=user
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.363: Streams.vala:97: Closing: https://persadon.com/api/v1/streaming/?stream=user
Tuba-INFO: 02:52:28.363: Streams.vala:86: TubaViewsHome > https://persadon.com/api/v1/streaming/?stream=user
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.363: Streams.vala:69: Opening stream: https://persadon.com/api/v1/streaming/?stream=user
Tuba-INFO: 02:52:28.369: Streams.vala:86: TubaViewsNotifications > https://persadon.com/api/v1/streaming/?stream=user:notification
Tuba-INFO: 02:52:28.369: Streams.vala:92: TubaViewsNotifications X https://persadon.com/api/v1/streaming/?stream=user:notification
Tuba-INFO: 02:52:28.370: Streams.vala:86: TubaViewsNotifications > https://persadon.com/api/v1/streaming/?stream=user:notification
Tuba-INFO: 02:52:28.376: Streams.vala:86: TubaViewsConversations > https://persadon.com/api/v1/streaming/?stream=direct
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.376: Streams.vala:69: Opening stream: https://persadon.com/api/v1/streaming/?stream=direct
Tuba-INFO: 02:52:28.376: Streams.vala:92: TubaViewsConversations X https://persadon.com/api/v1/streaming/?stream=direct
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.376: Streams.vala:97: Closing: https://persadon.com/api/v1/streaming/?stream=direct
Tuba-INFO: 02:52:28.377: Streams.vala:86: TubaViewsConversations > https://persadon.com/api/v1/streaming/?stream=direct
(dev.geopjr.Tuba:3): Tuba-DEBUG: 02:52:28.377: Streams.vala:69: Opening stream: https://persadon.com/api/v1/streaming/?stream=direct
library "eglSubDriverAndroid.so" not found

Instance Backend

Mastodon

Operating System

Debian 13 (Droidian)

Package

Flatpak

Troubleshooting information

os: GNOME 45 (Flatpak runtime) prefix: /app flatpak: true version: 0.5.0 (production) gtk: 4.12.3 (4.12.1) libadwaita: 1.4.0 (1.4.0) libsoup: 3.4.3 (3.4.3) libgtksourceview: 5.10.0 (5.10.0)

Additional Context

No response

GeopJr commented 9 months ago

Thanks for the info!

gsettings get dev.geopjr.Tuba muted-notification-types []

means that it never got saved - that's why it doesn't work (the expected result would be ['favourite']). In combination with the gfile errors on start, I suspect it has something to do with the host / Droidian, I'll setup a vm and investigate it further

danialbehzadi commented 9 months ago

if it helps, the mute works if I quickly open the preferences window and switch the category off before the posts appear on the app.

rmader commented 6 months ago

I suspect it has something to do with the host / Droidian

Hi, I just wanted to quickly add that I observe the same behavior on two setups, both using Fedora 40 and the Flatpak from Flathub.

GeopJr commented 6 months ago

I still can't reproduce it but I do have a guess, but first of all, please run:

$ flatpak run --command=sh dev.geopjr.Tuba
[📦 dev.geopjr.Tuba ~]$ gsettings get dev.geopjr.Tuba.Account:/dev/geopjr/Tuba/accounts/$(gsettings get dev.geopjr.Tuba active-account | tr -d \')/ muted-notification-types
[📦 dev.geopjr.Tuba ~]$ gsettings get dev.geopjr.Tuba work-in-background

If it's an empty array, my guess is that Tuba either gets killed rather than close normally and the settings are never saved (they get saved only on shutdown) or if work-in-background is true, it never gets the chance to shutdown

If my speculation is correct, I'll just make it save on window close instead of shutdown

rmader commented 6 months ago

Oh, actually this works for me - I get

['favourite']
false

and when restarting the app the settings is remembered. It just doesn't seem to have any effect - all notifications still show up under "Notifications", trigger the "unread" sysmbol, etc. Even after refreshing the page, restarting the app etc. And favourites clutter the page quite a bit :/

GeopJr commented 6 months ago

Oh I see what you mean now! Not sure if the OP is about this too and I misunderstood:

The setting is about Push notifications only / desktop notifications. NOT the notifications tab. That tab needs a refactoring anyway with the new 'notification requests' on the next mastodon version. There's #167, I'll prioritize it for the next minor!

rmader commented 6 months ago

Oh, I already wondered about that :D Thanks a lot, much appreciated!

danialbehzadi commented 6 months ago

No. I was about the desktop notifications. However I fixed this by manually setting the gsettings key inside AND outside of the container.