Skip to content
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

Merged
merged 23 commits into from
Nov 26, 2018
Merged

Queues tests #551

merged 23 commits into from
Nov 26, 2018

Conversation

bebehei
Copy link
Member

@bebehei bebehei commented Oct 1, 2018


Edit: Fixes #563

@bebehei bebehei force-pushed the queues-tests branch 4 times, most recently from a8b71d0 to f524df3 Compare October 2, 2018 15:17
@bebehei bebehei force-pushed the queues-tests branch 2 times, most recently from 8c7510f to 88aae62 Compare October 11, 2018 00:16
@bebehei bebehei added this to the v1.4.0 milestone Oct 11, 2018
@bebehei bebehei mentioned this pull request Nov 6, 2018
@bebehei bebehei force-pushed the queues-tests branch 5 times, most recently from b548680 to e66c1fa Compare November 14, 2018 17:50
@bebehei bebehei force-pushed the queues-tests branch 3 times, most recently from 6a1f40a to 7258b33 Compare November 15, 2018 11:13
@bebehei bebehei changed the title [WIP] Queues tests Queues tests Nov 15, 2018
@bebehei
Copy link
Member Author

bebehei commented Nov 15, 2018

@tsipinakis There's only one question, which bothers me and is independent of #502. could you please help me with this commit?

Ignore test(temporarily to get build results)

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?

@tsipinakis
Copy link
Member

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 stack_tag.

I consider this a bug and it was probably introduced in #552.

@tsipinakis
Copy link
Member

I pushed a fix @bebehei

@bebehei bebehei force-pushed the queues-tests branch 2 times, most recently from bd77815 to 893a92b Compare November 15, 2018 14:26
Copy link
Member

@tsipinakis tsipinakis left a 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.

test/queues.h Outdated Show resolved Hide resolved
test/queues.h Outdated Show resolved Hide resolved
test/queues.h Outdated Show resolved Hide resolved
test/queues.h Show resolved Hide resolved
test/queues.h Outdated Show resolved Hide resolved
src/dunst.c Outdated Show resolved Hide resolved
src/queues.c Show resolved Hide resolved
test/queues.c Show resolved Hide resolved
test/queues.c Outdated Show resolved Hide resolved
@bebehei
Copy link
Member Author

bebehei commented Nov 18, 2018

Most of the stuff is now fixed.

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.

This is now fixed. The visible field of the dunst_status structure was absolutely redundant. I tripped too much over the word visible, which had different meanings in different contexts.

But shame on me, that I requested your review, but did not even bother to run dunst 🤕

@bebehei
Copy link
Member Author

bebehei commented Nov 24, 2018

Heads up: I pushed a fixup for a small bug in my id assignment commit.

Thoughts in order:

  1. Yay, thanks!
  2. Wait, all your comments which got automatically marked outdated, aren't outdated anymore!?
  3. Surprise surprise, all my changes are gone! 🎉

I'm glad that I'm a GitHub beta member (you can click on the images to see the diff):

Force Push IMG

Force push tsipinakis

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/

tsipinakis and others added 22 commits November 24, 2018 15:22
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.
@tsipinakis
Copy link
Member

tsipinakis commented Nov 24, 2018

Surprise surprise, all my changes are gone! tada

Oh crap, sorry! Totally forgot to pull your changes before rebasing!

@bebehei
Copy link
Member Author

bebehei commented Nov 24, 2018

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);
Copy link
Member

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.

Copy link
Member Author

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.

@bebehei bebehei merged commit 7ba6ca9 into dunst-project:master Nov 26, 2018
@bebehei bebehei deleted the queues-tests branch November 26, 2018 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants