Menu ▾ ▴

#253 Reconcile unread notifications across Messenger inbox filters

open
nobody
6 days ago
2026-08-28
Anonymous
No

Originally created by: kristofferR

Status (2026-11-08)

Since this was filed, the main notification path no longer depends on the conversation list. Messenger raises its own notifications, keyed by message ID (#351). The badge reads unread and mute state from Messenger's local database (#352, PR [#376]), but only for the chats the active filter lists. What's left:

  • Read unread and mute state for all threads from the database (messenger-db.ts), not just the listed rows. That is the "non-visual state source" this issue prefers, and it makes the temporary switch to the All filter below unnecessary.
  • The DOM-row fallback for notifications still sees only listed rows. Check whether it still matters now that [#351] is the main path.

Problem

Chatpane's fallback notification discovery can inspect only conversations rendered by the active Messenger inbox filter. If the user leaves Unread, Groups, Communities, or another filtered view selected, the document title can report new unread activity while the corresponding conversation row remains outside the visible DOM.

That can reduce badge precision or leave fallback notifications without the conversation detail needed for mute filtering and routing.

Goal

Reconcile unread conversations across filters without changing the user's selected filter, scroll position, focus, or visible content.

Approach

  • Detect the selected conversation filter and whether an inactive filter reports unread activity.
  • Prefer a non-visual state/DOM source if Messenger exposes one.
  • If a temporary All-filter synchronization is the only reliable path:
  • model it as a serialized, cancellable state machine;
  • preserve and restore the selected filter, chat-list scroll offsets, focus, and pending conversation navigation;
  • prevent duplicate notifications and badge regressions during the transition;
  • avoid cloning the full conversation DOM or retaining message text;
  • time out and fail back to the current visible-only behavior.
  • Keep muted-conversation policy, account boundaries, delivered-fingerprint persistence, and auto-refresh coordination intact.
  • Disable synchronization on login, checkpoint, empty, or structurally unknown pages.

Verification

  • Pure tests for filter state transitions, cancellation, timeout, restore, and concurrent title changes.
  • Live checks with All, Unread, Groups, and Communities selected.
  • New muted and unmuted messages arriving outside the active filter.
  • No visual flicker, focus loss, unexpected navigation, duplicate alerts, or stale badges.

Related to [#243], which tracks current muted-count correctness.

Related

Tickets: #243
Tickets: #264
Tickets: #351
Tickets: #352
Tickets: #376

Discussion


Log in to post a comment.