Advanced Push Rule Editor silently strips the highlight tweak from mention rules #19

Closed
opened 2026-09-12 01:50:53 -04:00 by jared · 0 comments
Owner

Severity: high · Type: bug · Confidence: high

Location: src/app/features/settings/notifications/PushRuleEditor.tsx:132-145, src/app/hooks/useNotificationMode.ts:26-47

Problem

RuleModeSwitcher (used by every row in the "Advanced Push Rules" editor) calls useNotificationModeActions() with no options, so getModeActions(mode) always builds actions from scratch as [Notify] (+ a sound tweak for "Notify Loud") and never re-applies highlight. Writing mx.setPushRuleActions(...) with that action list replaces the rule's entire actions array. Default rules such as .m.rule.is_user_mention, .m.rule.contains_display_name, .m.rule.is_room_mention and .m.rule.at_room_notification normally ship with a highlight: true tweak; toggling their mode from this generic editor (e.g. switching "Notify Loud" → "Notify Silent" to mute the sound) silently drops the highlight tweak from the account-data push rule, which syncs to every client on the account. The parallel purpose-built editors for the same rules (SpecialMessages.tsx, KeywordMessages.tsx) correctly pass NotificationModeOptions{ highlight: true } — confirming this is an oversight specific to the generic Advanced editor, not an intentional simplification.

How to trigger

Settings → Notifications → Advanced Push Rules → expand "Override Rules" → change the mode of .m.rule.is_user_mention (or .m.rule.contains_display_name/.m.rule.is_room_mention) via the dropdown. The rule keeps notifying but a real @mention or display-name hit no longer highlights (red badge / bold) in the room list or timeline, on every device, until the user manually re-sets it from the Special Messages page.

Suggested fix

Have RuleModeSwitcher/getModeActions preserve any existing set_tweak: highlight (and non-default sound values) from pushRule.actions when rebuilding the action list, the same way SpecialMessages.tsx/KeywordMessages.tsx pass { highlight: true } — or read the existing tweaks off pushRule.actions instead of hard-coding options.


Filed from the September 2026 client audit (branch lotus @ 4bea4895).

**Severity:** high · **Type:** bug · **Confidence:** high **Location:** `src/app/features/settings/notifications/PushRuleEditor.tsx:132-145`, `src/app/hooks/useNotificationMode.ts:26-47` ### Problem `RuleModeSwitcher` (used by every row in the "Advanced Push Rules" editor) calls `useNotificationModeActions()` with **no options**, so `getModeActions(mode)` always builds actions from scratch as `[Notify]` (+ a `sound` tweak for "Notify Loud") and never re-applies `highlight`. Writing `mx.setPushRuleActions(...)` with that action list *replaces* the rule's entire actions array. Default rules such as `.m.rule.is_user_mention`, `.m.rule.contains_display_name`, `.m.rule.is_room_mention` and `.m.rule.at_room_notification` normally ship with a `highlight: true` tweak; toggling their mode from this generic editor (e.g. switching "Notify Loud" → "Notify Silent" to mute the sound) silently drops the highlight tweak from the account-data push rule, which syncs to every client on the account. The parallel purpose-built editors for the same rules (`SpecialMessages.tsx`, `KeywordMessages.tsx`) correctly pass `NotificationModeOptions{ highlight: true }` — confirming this is an oversight specific to the generic Advanced editor, not an intentional simplification. ### How to trigger Settings → Notifications → Advanced Push Rules → expand "Override Rules" → change the mode of `.m.rule.is_user_mention` (or `.m.rule.contains_display_name`/`.m.rule.is_room_mention`) via the dropdown. The rule keeps notifying but a real @mention or display-name hit no longer highlights (red badge / bold) in the room list or timeline, on every device, until the user manually re-sets it from the Special Messages page. ### Suggested fix Have `RuleModeSwitcher`/`getModeActions` preserve any existing `set_tweak: highlight` (and non-default sound values) from `pushRule.actions` when rebuilding the action list, the same way `SpecialMessages.tsx`/`KeywordMessages.tsx` pass `{ highlight: true }` — or read the existing tweaks off `pushRule.actions` instead of hard-coding options. --- _Filed from the September 2026 client audit (branch `lotus` @ 4bea4895)._
jared added this to the Audit 2026-09 · High milestone 2026-09-12 01:50:53 -04:00
jared added the bugpriority: higharea: notifications labels 2026-09-12 01:50:53 -04:00
jared self-assigned this 2026-09-12 01:50:53 -04:00
jared closed this issue 2026-09-12 02:14:51 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
2026-10-14
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#19