Skip to content

Unread count #98

Done
Done

Description

@schoolerani-spec

Summary

Improve the accuracy of unread message count detection by reliably syncing with WhatsApp Web's native unread state—ensuring counts stay accurate across incoming/read messages and update immediately when using WhatsApp's "Mark all as read" option.

Current Behavior

The unread message count displayed in the tray icon and in-app UI frequently drifts out of sync with the actual unread chats inside WhatsApp Web, and does not reliably clear or update when triggering "Mark all as read" in WhatsApp.

Summary

Improve the accuracy of unread message count detection by reliably syncing with WhatsApp Web's native unread state—ensuring counts stay accurate across incoming/read messages and update immediately when using WhatsApp's "Mark all as read" option.

Current Behavior

The unread message count displayed in the tray icon and in-app UI frequently drifts out of sync with the actual unread chats inside WhatsApp Web, and does not reliably clear or update when triggering "Mark all as read" in WhatsApp.

Proposed Solution

Synchronize whatRust's unread badge state directly with WhatsApp Web's authoritative unread indicators using safe, read-only observation:

  • Accurate Unread State Sync: Read the authoritative unread count/state directly from WhatsApp Web's native UI/title indicators (or passive DOM observation) rather than relying on fragile incremental message counting that can drift on sync, muted chats, or multi-device reads.
  • "Mark all as read" Compatibility: Ensure bulk read actions—specifically WhatsApp's "Mark all as read" option, as well as messages read on linked mobile/desktop devices—immediately trigger a change without refresh
  • Multi-Account Aggregation: Ensure each isolated account instance reports its exact synced unread count cleanly so the combined system tray badge reflects the true total.

Requirements & Constraints

  • Zero WhatsApp Web code tampering: Use strictly passive/read-only state inspection (e.g., observing WhatsApp's native document title count or read-only badge elements) without modifying WhatsApp Web's internal scripts, DOM, or network requests.
  • Respect badge visibility settings: Ensure synced unread updates integrate cleanly with any user preference to hide unread count badges.

Benefits

  • Eliminates ghost or inaccurate unread counters in the tray and account tabs.
  • Seamless synchronization when using "Mark all as read" or reading messages on another linked device.
  • Reliable multi-account unread totals without requiring manual app restarts or refreshes.

Benefits

  • Eliminates ghost or inaccurate unread counters in the tray and account tabs.
  • Seamless synchronization when using "Mark all as read" or reading messages on another linked device.
  • Reliable multi-account unread totals without requiring manual app restarts or refreshes.

Activity

  1. karem505 commented on Nov 26, 2026

    @karem505
    Owner

    Thanks @schoolerani-spec. Fixed in v0.7.1 (#137): the count is re-read within about 120 ms of a title or chat-list change instead of on a 2 s poll, so Mark all as read clears the badge at once, and titles like (1,234) or ones with direction marks are no longer read as 0. If it still drifts for you, please reopen with the steps.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions