Repository navigation
Conversation
The freedesktop spec says expireTimeout == 0 means "never expire", but a non-zero value should be honored regardless of urgency. The service mapped critical to duration 0 unconditionally, so a sender that asked for a finite timeout (e.g. `omarchy battery low` with `-t 30000`) got an immortal toast that survived every restart until manually dismissed. Critical alerts still never expire when the sender passes timeout 0. Fixes omacom#12911
Automated AI review
Verified: the change fixes #12911 and no correctness defect was found in the reviewed scope. A critical notification with a positive Verified: critical alerts sent without a timeout ( Only the in-repo critical senders that pass
The battery warning is sent once per discharge, so an unattended one now leaves the screen after 30 s and stays in history. If that warning should stay on screen, the lever is the sender's Short critical timeouts are now the shortest-lived toasts
The screen-recording errors ("Screen recording directory does not exist", "No webcam devices found", "Recording process had to be force-killed. Video may be corrupted.") therefore show for 3 to 5 s, shorter than a low-urgency toast with the same request. Impact: visibility only. Hovering pauses the countdown and the toasts still reach history. The same senders passed Suggested change: decide which behavior is intended. To keep critical alerts at least as visible as normal ones, floor positive critical requests the way normal ones are floored: return requested > 0 ? Math.min(maxPopupDuration, Math.max(normalPopupDuration, requested)) : 0Otherwise, keep the pass-through and document that explicitly timed critical toasts use the sender's timeout as given. Documentation: Rationale wording: the PR description says the freedesktop spec requires honoring a non-zero timeout "regardless of urgency". Specification 1.3's urgency section says critical notifications "should not automatically expire", so the previous critical-means-0 rule was not a spec violation. The firmer basis for the change is the explicit sender request, and that it restores the stock mako behavior from before c101591: mako honored a positive timeout on critical notifications, and Optional test improvement: the new assertion is a regex over the Review informationTest scope: Source review of the notification service, AI process: Opus 5.5 Medium coordination and synthesis; independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, with a targeted follow-up to confirm points only one of them had established; Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks, in 2d19a2e timed critical toasts are floored at the normal duration, so they are never the shortest-lived toast. Updated |
Automated AI review
Follow-up to the earlier review (at 6b95224) and the author's reply, checked at head 2d19a2e. Verified: 2d19a2e and the edited PR description resolve the short-critical-timeout finding, the stale documentation and the PR description's spec rationale. The optional test improvement still applies. No regression from 2d19a2e was found, and the #12911 fix still holds: the issue's persisted battery toast (critical, 30000 ms, 18 h old) is archived on restore.
Verified, short critical timeouts: the critical branch of Low and normal results are identical at base, the earlier head and this head. Correction to the earlier sender table: the three screen-recording rows no longer hold. Verified, documentation: Verified, rationale: the PR description now rests on the sender's explicit request and the earlier mako behavior, with no spec-violation claim. The message of commit 6b95224 still presents honoring a non-zero timeout "regardless of urgency" as what the freedesktop spec says. That sentence enters history if the commit is merged as is. Optional test improvement (still applies): the updated assertion is still a regex over the Related open PRs: #12964, #13041, #13159, #13161 and #8675 also edit the critical branch of Narrower earlier statement, in-place updates: the earlier review listed in-place updates as unchanged. One narrow case changed from the first commit on. A Review informationTest scope: Source review of the incremental and full diff at 2d19a2e, the notification service, AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Critical toasts always used duration 0, so senders like omarchy-battery-low (-t 30000) never expired and were restored forever. Keep untimed critical immortal; honour a positive expireTimeout (omacom#13100). Co-authored-by: AnPod <AnPod@users.noreply.github.com>
|
Reviewed at Three other open pull requests fix #12911 in the same function, so this one was compared against them rather than run on a worker:
Two things separate this pull request from #12964:
Claude Opus 5.5 and Codex Medium each judged #12964 the one to carry forward. Codex Medium was asked separately and without Claude's answer, but its independence from this review is not guaranteed. Both noted that this pull request has one thing #12964 lacks. This waits on the maintainer. If the 8s floor is what they want, this pull request is the better match, but it would need a test that calls the duration logic itself instead of matching the source text. Otherwise #12964 needs this pull request's documentation change, and the rest can be closed. |
|
Thanks @surim0n, this fixes #12911 and the documentation wording is useful. We compared the five direct candidates on current |
The docs, the popupExpired comment and a test label still said every critical toast stays until dismissed, which stopped being true when a sender's timeout began to be honoured. Wording from omacom#13100. Co-Authored-By: surim0n <suritech@gmail.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @surim0n! In the new notification engine (#15932) that's deliberate: critical means "stays until you dismiss it" ( |
Summary
durationFor()mappedNotificationUrgency.Criticalto duration 0 unconditionally, discarding the sender'sexpireTimeoutomarchy battery low, which sends-u critical -t 30000) never expired on screen, its state file was never archived, andrestorePopups()re-showed it with a fresh lifetime on every shell restart, indefinitelydefault-timeout=0rule only applied when none was given-1or0) still never expire and are still restored across restartsmaxPopupDuration, so it is never the shortest-lived toast on screenFixes #12911
Test plan
bash test/shell.d/notifications-test.shpasses, including the new critical-branch assertionomarchy notification send -u critical -t 30000 "Repro" "critical + 30s timeout", restart shell, confirm the toast expires instead of resurrecting