-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dunstify hangs indefinitely when using Action and get replaced #672
Comments
It's sadly an unfortunate side effect of how replacing is being done. It might seem logical that if a notification is replaced we should notify the first sender that it was closed. However, as I read this feature of the notification spec it's meant to be used within the same program to update an existing notification, which would lead to a very confusing callback if we send a So it's indeed the logical thing to do for dunstify, but for other (more common) use-cases we might end up confusing or straight up breaking other programs. |
doesn't dbus identify the sender? Maybe store that in the notification structure and only send the close event when it differs? Edit: That is already stored in |
Technically it's possible, but I would classify it into the 'ugly hack' category and be very hesitant to merge that into the main tree as we're stepping on the lines on what's properly defined and not so it could lead to some very confusing behaviour down the road. @Jonathas-Conceicao This specific behaviour aside, what's the use-case you're actually trying to accomplish here, are you aware of e.g. Notifications with the same tag ("test" in this example) are replaced without having to care for ids.
For higher level uses it's best to stick to using that rather than micro-managing IDs as that has many hidden pitfalls. |
True. I think even the ability to replace or close notifications that were created by a different client is on that line. |
Indeed this would fit right into dunsts id handling which is why I didn't dismiss that idea. Dunst has always handled ids weirdly deviating a bit from the spec. i.e in the spec it's not allowed to use For this reason we implemented So, aside from all the uncertainties, I would be all for adding this if we weren't trying to move away from using |
I have a script that send notifications with music lyrics stanza by stanza and I use Actions to pass through them. I eventually noticed some calls to dunstify were hanging indefinitely when a new music on spotify started and the notification for the new song replaced the old one.
I have had a quick look on it when I was writing my script, but as replacing seamed easier to use and I though it would do the trick I went for it. I have tested with it now and it does seams to sove my problems. |
I'll be closing this since replace doesn't send a close to the old notification by design and the desired behaviour can be accomplished by using stack_tag. |
If dunstify is called with Action, and is then replaced by some new notification, the first call will then be left hanging indefinitely. e.g:
Form shell 1:
dunstify -r 313 "Testing" -A 'tested,default'
After that, from a new shell:
dunstify -r 313 "New Test"
The call on shell 1 will never finish. However If a
-C 313
is used before sending the second notification, the first call to dunstify exits with a 3, as expected.Is this the desired behaviour or a bug? I would expect a replace call to also close the notification with the conflicting id.
Installation info
Dunst - A customizable and lightweight notification-daemon 1.4.1 (2019-07-03)
package
Arch Linux
The text was updated successfully, but these errors were encountered: