Closed tobast closed 2 months ago
Looks good to me. We have to wait for the ci to work again though
You could maybe use an #if to use the new glib function where available
You could maybe use an #if to use the new glib function where available
Wouldn't that be just redundant, given that currently this does the same thing?
In my opinion, using g_timeout_add_once
adds a slight bit of robustness, but adding conditionals on the version of glib would decrease robustness -- eventually one of the branches of the preprocessor would be changed without the other being updated, etc., causing more opportunities for bugs than it remedies to.
Could you please rebase to master for the ci?
Attention: Patch coverage is 0%
with 16 lines
in your changes are missing coverage. Please review.
Project coverage is 65.64%. Comparing base (
bd5b333
) to head (5702095
). Report is 3 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
src/dunst.c | 0.00% | 16 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks @tobast
Whoops, sorry for not merging the review! I've been pretty busy…
This logic was over-complicated and caused multiple bugs. This hopefully remediates to this for good. Fixes #1196.
I finally took the time to look at the timer logic of the
run
function, check what was actually needed, and came up with this simplification. I tried to document it in the function, feedback welcome :)This passes
make test
correctly:Issue #1196 is also fixed: I tried manually the scenarios I could think of (including the one mentioned in the issue) and could not get a
Source ID xx was not found
error.Note for the future: replacing
g_timeout_add
withg_timeout_add_once
would enhance robustness, in case a bug causes two timers to be running concurrently — which would double the number of invocations ofrun
unnecessarily, until no notifications are shown for a time, and could exponentially blow-up if the bug occurs within the bug. However, this function was introduced in GLib 2.74, which is too recent for eg. Debian Bullseye.