Repository navigation
Conversation
Automated AI review
Verified: The change does what the description says. A critical toast now counts down from 30 s, pauses while hovered, moves into history on expiry, and can still be dismissed early by right-click, the close button or the dismiss bindings. The accumulation problem is real in the repository: The main concern is that critical was the only way to get a toast that waits for the user, and several first-party senders and the user manual depend on that. Critical toasts no longer wait for the user, which first-party senders and the manual rely onCommit
The expired entries still reach history, but history keeps only the newest 10 entries and opens only through the history binding, and nothing shows that a critical toast expired unseen. The freedesktop Desktop Notifications Specification (Urgency Levels) also says critical notifications "should not automatically expire". Impact: On an unattended machine, which is the case this PR targets, these prompts are gone from the screen by the time the user returns. For the one-time invitations and the FIDO2 warning, the toast is the only notice. Suggested change: Address accumulation without removing the waiting behavior. Two approaches:
If the flat cap is kept, Third-party critical notifications are closed as expired, not only hiddenOn expiry the service calls Impact: The description's "nothing is lost" holds for the text and for Omarchy's own click actions, but not for interactive third-party notifications. Suggested change: If the flat cap is kept, state this trade-off in the description and in A notification escalated to critical late in its life can vanish almost immediatelyThe card countdown stores the remaining lifetime as a fraction, and it is reset only when the summary, body or image changes (
Derived from source; not run. Impact: An alert raised to critical because it became more urgent can be on screen for less time than a fresh normal toast. Suggested change: Reset Pre-existing, now reaches critical toasts: With more than one monitor, each screen's copy of a toast runs its own timer, and hover pauses only the copy under the pointer. The first unhovered copy to reach zero removes the toast everywhere, so a critical toast being read on one monitor still expires at about 30 s. Critical toasts were previously exempt because their lifetime was 0. Confirmed from source only. Review informationTest scope: Source review of head AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted follow-ups, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Capping critical popups broke the one thing critical means. Taildrop announcements, pending migrations, crash toasts, the sleep-lock warning and the first-run hooks all send critical with no timeout because they want the toast to wait, and manual/35-networking.md promises exactly that for a file that arrives while nobody is at the machine. A cap took all of them off the screen after 30s, and for the one-time invitations the toast was the only notice there was. So critical waits again, and the only thing allowed to shorten one is a sender that says so: a positive expire_timeout is honoured, clamped like any other urgency between the normal floor and the 30s ceiling the rest already had. omarchy-battery-low is the first-party sender that asks, and now gets what it asked for. The policy moves to NotificationLogic.js so it can be tested, which nothing covered before. The service passes its NotificationUrgency values in, the way it already does for shouldBypassDnd. A sender raising urgency or asking for a different lifetime through replaces_id also gets the countdown restarted. The card resets its fraction on new text but not on those two, so a toast escalated at the end of its life inherited a clock that had almost run out and was dropped seconds after it became more urgent.
omarchy-crash-watch re-announces a crash-looping program every 60 seconds, and every one of those toasts is critical, so on a machine nobody is sitting at they collected one per looping program per minute and stayed there. The watcher now reads back the id the server gave it and hands the same id back as replaces_id, so the re-announcement updates that one toast. The id is the server's to hand out, so it is learned with -p rather than invented: the server matches a replaces_id only against a notification it still holds, and a number nobody handed out names whichever live notification happens to hold it. Reading it back on every announcement also heals the stored id once the toast has been dismissed. docs/notifications.md documents the lifetime rule, the two sender flags this now relies on, and what the crash watcher sends.
e88cf11 to
0eb4399
Compare
|
All three findings were right, and the first one changed the design. The branch is now two commits on the current 1. Critical no longer stops waiting for the user. I had listed the alternative in the description and then picked the flat cap anyway, which was the wrong call: the six senders you found all send critical precisely because they want the toast to wait, and I took your first option rather than a stack cap. A stack cap has to evict something, and the oldest critical toast is exactly the unopened Taildrop arrival the user came back for. 2. Third-party interactive notifications. This dissolves with the change above: a sender that did not request a timeout is no longer expired at all, so 3. Late escalation carrying the countdown over. Fixed, and I extended it one step: The accumulation the flat cap was aimed at. With critical waiting again, that has to be fixed at the source, so Your multi-monitor point. Agreed it is pre-existing, and the change leaves less of it exposed: a sticky critical toast has no timer on any monitor to disagree about. Still worth its own issue if you agree it bites the toasts that do expire. Tests. Not verified: a live shell. The policy and the id handling are covered by tests; I did not watch a toast count down in a running session, since driving the real notification server here would have disturbed it. Thanks, this made the PR better than the one I opened. |
Automated AI review
Follow-up to the earlier review and the author's reply, checked at Verified: The redesign resolves the earlier findings. Critical toasts wait again unless the sender asks for a timeout, and the new
Verified: Within one shell process, the Stored crash-toast ids can outlive the shell that issued them
This was reproduced in a model: the real Impact: When the old id collides with a toast the new shell still holds, that toast's text and click command are replaced in place and never reach history. Waiting critical toasts stay held indefinitely, so a collision is plausible, though not frequent. When there is no collision, the server adds a new crash toast, next to the earlier one if that was still on screen at the restart and was restored from disk. As a result, a crash loop that spans restarts still stacks, and so does a crash loop of the shell itself, the crash the watcher's own comment calls the most worth reporting. Suggested change: Forget the stored ids when the unique bus name that owns Correction to the reply: The reply and commit Optional test improvement: In Related open PRs: #13159 changes the same PR title: The title still describes the flat cap; a title describing the current rule (critical waits unless the sender requests a timeout) would match the change. Review informationTest scope: Follow-up review of head 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. |
|
For the maintainer's comparison: the new Note that this rule doesn't change the #13153 case (Chrome sends critical with |
|
The explicit-timeout part here overlaps the older, verified #12964, which we've recommended to the maintainers. This PR isn't a pure duplicate though: the |
|
Closing this in favour of #11782, which solves the same two problems (one toast per crashing program, and critical toasts that eventually expire) with a different design, and the two can't both land: rebased onto the current quattro they conflict in A fresh review of the rebased branch also turned up two problems with this approach. The watcher keeps its The one piece worth keeping, restarting the countdown when an update changes only the urgency or the timeout, is now in #11782 (fb286ae). Thanks to everyone who reviewed this, the two rounds shaped that fix. |
What
A critical notification popup waits for the user:
durationFor()returns0forNotificationUrgency.Critical, so it stays on screen until it is clicked,dismissed or replaced. That is what the first-party senders are for. Taildrop
announcements (
manual/35-networking.mdpromises the toast waits), pendingmigrations, a crash to diagnose, the sleep-lock warning and the first-run setup
hooks all send critical with no
expire_timeout, because they mean "wait for me".So the rule is now: critical waits unless the sender states a timeout. A
positive
expire_timeoutis honoured for critical too, clamped like every otherurgency between the normal floor and the 30s ceiling the rest already had.
The policy moved to
NotificationLogic.jsso it can be tested, which nothingcovered before. The service passes its
NotificationUrgencyvalues in, the wayit already does for
shouldBypassDnd.Why not a flat cap
An earlier commit on this branch capped critical popups at
maxPopupDuration. Itwas one line, and it broke the contract above: those toasts were gone 30s after
they appeared, so on an unattended machine they were gone before the user came
back, and for the one-time invitations the toast was the only notice there was.
The accumulation this was meant to fix
The source of an unattended pile-up is
omarchy-crash-watch, which re-announces acrash-looping program every 60s, each announcement a critical toast that waits. It
now reads back the id the server gave it and hands that same id back as
replaces_id, so a loop updates one toast instead of adding one per minute. Theid is the server's to hand out, so it is learned with
-p(the patternomarchy-display-text-sizealready uses) rather than invented:replaces_idismatched only against a notification the server still holds, and a number nobody
handed out names whichever live notification happens to hold it.
Fixed in passing: a sender that raises urgency, or asks for a different lifetime,
through
replaces_idno longer inherits the countdown fraction it already had, soa toast escalated at the end of its life is not dropped seconds later.
Verification
test/shell.d/notifications-test.sh: the duration policy, including the criticalcase that had no coverage before.
test/shell.d/crash-capture-test.sh: the stubbed server now hands out ids the waythe real one does, and the assertions check that the watcher hands back the id it
was given, keeps one per program, and gives two different programs different ids.
notification-send-test.sh,migrate-notify-test.sh,tailscale-receive-test.shand
apply-lock-test.shpass.bash test/shell: 7 failures on this machine, all pre-existing and none in thefiles this touches (kernel headers, snapper, screenshot sanity, ssh reconnect, an
untracked
/usr/share/owefile, version).above, but the on-screen countdown was not exercised in a running session.