From 08349a30ca4221d399559481cb520864e5fe8d8a Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 15 Sep 2026 14:05:38 +0200 Subject: fix: honour the freedesktop expire_timeout direction The spec says -1 means the server decides and 0 means never; the code had them swapped, so a plain notify-send (libnotify's default is -1) became immortal and an explicit never (-t 0) got the urgency default. Found by the live handover test, where notify-send produced expires 0. The urgency default is unchanged: low and normal 10s, critical never. --- internal/notify/policy_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/notify/policy_test.go') diff --git a/internal/notify/policy_test.go b/internal/notify/policy_test.go index ef5bb72..378c573 100644 --- a/internal/notify/policy_test.go +++ b/internal/notify/policy_test.go @@ -46,10 +46,10 @@ func TestEffectiveTimeoutMS(t *testing.T) { u Urgency want int64 }{ - {"zero uses low default", 0, Low, 10_000}, - {"zero uses normal default", 0, Normal, 10_000}, - {"zero critical never", 0, Critical, 0}, - {"minus one never", -1, Normal, 0}, + {"minus one uses low default", -1, Low, 10_000}, + {"minus one uses normal default", -1, Normal, 10_000}, + {"minus one critical never", -1, Critical, 0}, + {"zero never", 0, Normal, 0}, {"explicit wins", 3_000, Normal, 3_000}, {"sub second exact", 1, Normal, 1}, } -- cgit v1.2.3