-
Notifications
You must be signed in to change notification settings - Fork 337
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
Queues tests #551
Queues tests #551
Conversation
a8b71d0
to
f524df3
Compare
8c7510f
to
88aae62
Compare
b548680
to
e66c1fa
Compare
6a1f40a
to
7258b33
Compare
@tsipinakis There's only one question, which bothers me and is independent of #502. could you please help me with this commit?
If I'm passing a notification with the ID 1000 and there hadn't been a notification with 1000 before, why does the notification have to get a new ID? This hit me quite unexpected. I expected to actually use 1000 as the ID. I don't remember it why, but I remember we had a discussion about that. Do you have any reasons to or the actual discussion? |
That's a very good catch! We hadn't had a discussion on it but previously we assigned the ID asked anyway. The notification spec doesn't specify what to do if the ID is invalid but we should preserve the previous behaviour to not break those that use a static id replacement as the old workaround for I consider this a bug and it was probably introduced in #552. |
I pushed a fix @bebehei |
bd77815
to
893a92b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also found a bug: After a notification is shown and closed the dunst window isn't hidden, a small black rectangle keeps being displayed (and moves around the screens with the cursor as would be expected). Bisect showed 052d9f7 as the broken commit.
2545960
to
7b10185
Compare
Most of the stuff is now fixed.
This is now fixed. The But shame on me, that I requested your review, but did not even bother to run dunst 🤕 |
7b10185
to
7946994
Compare
Thoughts in order:
I'm glad that I'm a GitHub beta member (you can click on the images to see the diff): Please fetch the upstream pull request the next time first. If you need to fetch them very easily, there's a simple refspec available to fetch the GitHub PRs automatically: https://bebehei.de/github-prs/ |
In previous releases when a replace request came in with an id that doesn't exist we created a new notification with it anyway. This is used by some to imitate the behaviour of `stack_tag` and while not recommended (as it will break if another notification gets assigned that id) we want to avoid such subtle breakages without consideration. This bug was introduced in d879d70.
When using a format with a trailing % character, dunst ends in an endless loop, searching for a % char, while pointing exactly with the haystack on the % character. Increasing the substring pointer will shift the pointer forwards onto the actual NULL character and stop the loop.
Only if the queue is full, dunst should swap the most important notifications from waiting with the least important notifications from displayed.
Notifications listed in the waiting queue are never shown :see_no_evil:
These aren't used anymore. Any notification which gets moved from waiting to displayed, will have set the start field with the current monotonic time. So testing start == 0 won't ever succeed in queues_notification_is_finished, as the tested notification is contained in the displayed queue. So the start field never will be 0. Also there's no semantics for start being 0 in dunst actually implemented.
811090d
to
93f6eb5
Compare
Oh crap, sorry! Totally forgot to pull your changes before rebasing! |
Well, this happens. Would you mind giving a final review? |
|
||
n1 = test_notification("n1", 1); | ||
n2 = test_notification("n2", 1); | ||
n3 = test_notification("n3", 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this again the timeout parameter does seem redundant. What's the point in setting it to 1
here? Any value wouldn't make a difference as we aren't advancing time.
But anyway, that's a complete nitpick everything else looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is a typo introduced via vim block mode during refactoring.
Edit: Fixes #563