Menu ▾ ▴

#246 feat: skip badge and notifications for muted chats

closed
nobody
None
2026-10-05
2026-08-25
Anonymous
No

Originally created by: kristofferR

Messenger includes muted threads in its unread title count, and notification events can arrive before or after the corresponding virtualized conversation row.

This replaces [#245] with clean history and fixes the races and DOM-selector gaps found during review.

  • Correlates page and row notification signals in either order.
  • Rechecks settings and mute state at the delivery boundary.
  • Detects Messenger’s current unlabeled slashed-bell row icon with strict shape and scope checks.
  • Invalidates cached state on explicit Unmute actions.
  • Preserves filtered badge state while conversation rows are virtualized.

Validation: 401 Bun tests, Biome, TypeScript, inject regeneration, rustfmt, Clippy with warnings denied, and 228 Rust tests. The current muted-row DOM was also verified in an isolated authenticated debug webview.

Supersedes [#245]
Ref [#243]

Summary by CodeRabbit

  • New Features
  • Added an “Ignore muted conversations” Messenger setting, enabled by default.
  • Muted chats and communities no longer trigger notifications or badge counts when enabled.
  • Badge-count guidance now explains how muted conversations affect unread totals.
  • Bug Fixes
  • Improved muted-state detection as conversations open, update, virtualize, or become unmuted.
  • Improved notification matching to prevent delayed, duplicate, or incorrectly attributed alerts.
  • Improved badge accuracy during conversation loading and updates.

Related

Tickets: #243
Tickets: #245
Tickets: #323

Discussion

1 2 > >> (Page 1 of 2)
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: coderabbitai[bot]

    ✅ Action performed Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: coderabbitai[bot]

    Review Change Stack

    [!NOTE]

    Reviews paused

    It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

    Use the following commands to manage reviews:
    - @coderabbitai resume to resume automatic reviews.
    - @coderabbitai review to trigger a single review.

    Use the checkboxes below for quick actions:
    - [ ] ▶️ Resume reviews
    - [ ] 🔍 Trigger review

    📝 Walkthrough ## Walkthrough This change adds a setting to ignore muted Messenger conversations. It detects mute state from rows and open threads, suppresses muted native notifications, filters muted unread conversations from badge logic, replaces notification fallback matching with a correlation queue, and adds tests and diagnostics. ### Changes **Messenger muted conversation filtering** |Layer / File(s)|Summary| |---|---| |**Settings and mute observation**
    `inject/src/types.d.ts`, `src-tauri/src/settings.rs`, `dist/settings.html`, `inject/src/messenger/lib/mute.ts`, `inject/src/messenger/index.ts`, `inject/src/messenger/lib/mute.test.ts`, `src-tauri/inject/messenger.js`, `src-tauri/inject/mcp-bridge.js`|Adds `ignore_muted_conversations`, enables it by default, and exposes it in the Notifications UI. Adds localized label parsing, row-icon detection, row and open-thread observation, cached mute state, explicit action invalidation, initialization, diagnostics, and tests.| |**Notification correlation and suppression**
    `inject/src/messenger/lib/notification-fallback.ts`, `inject/src/messenger/features/notifications.ts`, `inject/src/messenger/lib/notification-fallback.test.ts`, `src-tauri/inject/messenger.js`|Adds `NotificationCorrelationQueue` for page and row matching in either event order. Page notifications wait for delayed matches, carry mute state, re-check settings and mute state at delivery time, suppress muted deliveries, and persist handled fingerprints.| |**Unread filtering and badge reconciliation**
    `inject/src/messenger/lib/unread.ts`, `inject/src/messenger/features/unread-badge.ts`, `inject/src/messenger/features/notifications.ts`, `inject/src/messenger/lib/unread.test.ts`, `inject/src/messenger/lib/notification-fallback.test.ts`, `src-tauri/inject/messenger.js`|Unread scanning excludes muted conversations from notification keys and badge counts when configured. Reconciliation tracks muted-unread knowledge and filtered baselines, preserves trusted filtered counts across virtualization, and returns `null` when no trustworthy count exists.| **Estimated code review effort:** 5 (Critical) | ~95 minutes **Merge Risk:** _🟡 Moderate_ · up to `ffa5e` The change is intended to suppress badges and notifications for muted chats, but the current implementation can still notify for muted conversations, drop legitimate notifications, or undercount badges in specific race, routing, and virtualization cases. These are concrete merge-readiness issues that should be fixed or explicitly accepted before merging. ### Sequence Diagram(s) :::mermaid sequenceDiagram participant Messenger as Messenger UI participant Queue as NotificationCorrelationQueue participant Mute as Mute state observers participant Carrier as Notification delivery participant Store as NotifiedSignatureStore Messenger->>Mute: Observe row or open-thread mute state Messenger->>Queue: Register page notification or unread row Queue->>Carrier: Return matched page-row data Carrier->>Mute: Check muted thread and settings alt Muted delivery Carrier->>Store: markSuppressed(fingerprint) else Allowed delivery Carrier->>Store: markNotified(fingerprint) end
    🚥 Pre-merge checks | ✅ 4 | ❌ 1 ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 34.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 79 functions across 15 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
    ✅ Passed checks (4 passed) | Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------------------ | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title clearly and concisely summarizes the primary change: excluding muted chats from badge counts and notifications. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
    ✨ Finishing Touches 💡 1
    📝 Generate docstrings 💡 - [ ] Create stacked PR - [ ] Commit on current branch
    🧪 Generate unit tests (beta) - [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/pr-245-clean`

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    ❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

    Comment @coderabbitai help to get the list of available commands.

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: chatgpt-codex-connector[bot]

    Codex Review: Didn't find any major issues. Swish!

    Reviewed commit: 7949b32395

    ℹ️ About Codex in GitHub
    [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: coderabbitai[bot]

    ⚠️ Action not completed Review rate limited. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: coderabbitai[bot]

    ✅ Action performed Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: coderabbitai[bot]

    ✅ Action performed Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: coderabbitai[bot]

    ⚠️ Action not completed Review rate limited. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
  • Anonymous

    Anonymous - 2026-08-25

    Originally posted by: kristofferR

    @codex review

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.