Menu β–Ύ β–΄

#376 feat(badge): read unread and mute state from Messenger's database

closed
nobody
None
2026-11-07
2026-11-07
Anonymous
No

Originally created by: kristofferR

The unread badge guessed which chats are unread from bold text, and which are muted from localized labels in eight languages, an icon fingerprint and pixel offsets. Those guesses break on new locales, theme or markup changes.

Messenger's local database already holds the facts the list renders: MWPIsThreadUnread.isThreadUnreadForViewer decides a chat's "Unread message:" label, and muteExpireTimeMs says whether it is muted (-1 forever, or a future time). The badge now reads both for the listed chats and prefers them. The rendering heuristics stay as the fallback for any chat the database can't answer for, and a diagnostics line notes when the database is unavailable. Database mute state also feeds the shared muted-thread store that notifications use.

Reads are asynchronous, so the count uses the latest snapshot and re-applies when a refresh changes it. Unanswered or failed reads drop their cached entries so rendered evidence takes over again, and an explicit mute or unmute outranks database reads for a few seconds while Messenger writes the change.

Idea from fMess (MIT).

Manual check still needed: badge count across languages and with chats below the fold; mute for an hour, mute forever and unmute; Carrier.log should not show badge.thread-state.

Ref [#352]

CodeRabbit reviews this change in the combined PR [#394].

Related

Tickets: #253
Tickets: #352
Tickets: #394
Tickets: #398

Discussion

  • Anonymous

    Anonymous - 2026-11-07

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

    Codex Review Summary: βœ… Completed This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | πŸ“ **Code Review** | βœ… **Completed** <relative-time datetime="2026-11-07T16:05:30.311752Z">2026-11-07T16:05:30.311752Z</relative-time> | `44e03b4` | Manual request |
    ℹ️ 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" or "@codex security review". Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.
     
  • Anonymous

    Anonymous - 2026-11-07

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

    Codex Review: Didn't find any major issues. πŸŽ‰

    Reviewed commit: 44e03b4b0f

    ℹ️ 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-11-07

    Originally posted by: kristofferR

    ⏸️ crq will not request further automated reviews for this pull request.

    Reason: CodeRabbit reviews these changes once, in combined PR [#394]

    Resume with crq unhold kristofferr/carrier 376.

     

    Related

    Tickets: #394

  • Anonymous

    Anonymous - 2026-11-07

    Ticket changed by: kristofferR

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2026-11-07

    Originally posted by: kristofferR

    βœ… The administrative hold has been retired because this pull request merged. crq will not request further automated reviews.

     

Log in to post a comment.