Skip to content

Group duplicate notifications with a count - #12884

Closed
DCPRevere wants to merge 2 commits into
omacom:quattrofrom
DCPRevere:notification-deduplication
Closed

DCPRevere wants to merge 2 commits into
omacom:quattrofrom
DCPRevere:notification-deduplication

Conversation

@DCPRevere

Copy link
Copy Markdown

Multiple Teams windows can send identical notifications. Group matching notifications into one popup with a (2), (3), etc. count until dismissed or expired.

Keep every member tracked so updates can split changed messages into separate popups and dismissal closes the whole group. Add notifications.deduplicationWindowMs to set a time limit or disable grouping.

Tested with the notification test suites and on the desktop, including delayed duplicates and updates to both the original and duplicate notifications.

@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

One update-lifetime regression found at 81d2031d.

A changed group member can expire on another popup's old countdown

In Service.qml:344-350, the content-changing split calls insertGrouped(updated). If another live popup already matches the updated content, that arrival matcher absorbs the member into the older popup instead of creating the documented separate popup. Its count changes, but its countdown does not reset.

Synthetic native-notification reproduction, default grouping and normal urgency, with other matching fields equal:

1. B popup: id 1, less than 2 seconds remaining
2. A popup: newly arrived ids 2 and 3, grouped
3. Replace id 3's body: A -> B

                  Base                       PR head
id 3 after update Separate B popup           Joins id 1's old B popup
When id 1 expires Still live, ~76% remaining Closed as Expired with id 1

Impact: Updated content can disappear on an older popup's residual lifetime rather than receive its own full display interval. In this run, id 3 expired about 1.85 seconds after the post-update observation. This concerns an update to an existing grouped member, not the intentional grouping of new arrivals.

Suggested change: Insert the split member directly as a new singleton group, retaining its freshly computed timestamp, instead of rerunning arrival deduplication. Add a regression case with an older matching popup present that checks separate membership and independent expiry. The proposed correction has not been tested.

Verified: Ordinary duplicate grouping, unchanged replacements, remaining-member action promotion, and collective expiry passed the exercised checks.


Review information

Test scope: Base 947e2fc0 versus head 81d2031d. Existing notification tests and the new deduplication test passed. The lifetime comparison used synthetic D-Bus clients, native Quickshell notification objects and QML ListModel, with production service functions and countdown logic extracted unchanged into an offscreen fixture. Hover was disabled and persistence stubbed. Full desktop rendering, real application integrations, and restart persistence were not tested end to end.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra initial inspection, independent Fable 5.1 High and Astra Xhigh technical assessments, followed by synthesis and verification against source and targeted evidence. Fable subsequently checked the Astra-discovered lifetime finding against its saved evidence; that check was not an independent rerun.

@DCPRevere

DCPRevere commented Sep 22, 2026 •

Copy link
Copy Markdown
Author

@llstrk Fixed in f7df713. Split updates now create a singleton with its own lifetime. Added regression coverage for an older matching popup and independent expiry; all three notification test scripts pass.

@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

Verified: the earlier update-lifetime finding is resolved at f7df713b. A content-changing group member now takes the singleton insertion path rather than arrival deduplication. No new issue was found in this follow-up's directly affected scope.

Production service functions exercised with synthetic notifications and a modeled ListModel gave this result, including when the changed member was the original group representative:

Changed A member becomes B while an older B popup exists Original 81d2031d Current f7df713b
Updated member Joins the older B row Gets a separate singleton row
Explicitly expire the older B popup Updated member closes too Updated member remains tracked

The separate row gets its own countdown according to the inspected delegate code; elapsed native-QML timing was not rerun. Ordinary new-arrival grouping remains intact.

Verified: All three notification test scripts pass at the current head. The added regression case passes there and fails at the separate-membership assertion against both the original revision and a diagnostic one-line revert of the fix.


Review information

Test scope: Scoped original/current source comparison, independent modeled service tests and repository notification tests. Notification objects, ListModel and persistence were modeled; full desktop rendering, native D-Bus/QML timing, real application integration and restart persistence were not retested end to end.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Fresh independent Opus 5 xhigh and Astra Xhigh follow-up assessments, followed by Astra coordination, synthesis and verification against source and saved targeted evidence.

@ryanrhughes

Copy link
Copy Markdown
Collaborator

Thanks @DCPRevere! The new engine stacks cards into decks by source, so a burst from the same app collapses into one deck you can hover to open (with stacking: "all" you get a count badge). It's not exact-duplicate merging, but the wall of identical Teams toasts is gone. Closing since the new notification engine (#15932) changes how this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants