Menu β–Ύ β–΄

#384 feat(notifications): let Messenger raise its own notifications

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

Originally created by: kristofferR

Carrier.log on both Kris's Mac and Omarchy shows that Facebook never raises a Web Notification inside Carrier (notify.fired 0 times, against hundreds of notify.fallback). Every Carrier notification was reconstructed from the chat list, guessing the conversation and sender from text.

Why: Messenger's useMWLSChatPopperUpper only notifies when it believes it is the installed messenger.com app (isMessengerPWA() && justknobx._("1465")) and the page is hidden. Neither holds in Carrier.

What this changes:

  • Rewrites exactly those two checks so Messenger notifies whenever the window is hidden or unfocused. The page forbids eval, so the rewritten module loads as a blob: script. If either pattern no longer matches exactly once, or the page refuses the script, the original module runs unchanged and notify.page-rewrite explains why in Carrier.log; notify.page-enabled confirms success.
  • Wraps MWDesktopNotifications.triggerLocalNotification to record each notified message's conversation under its message id. Messenger uses that id as the notification's tag, so a page notification now carries its exact conversation (notify.identity).
  • Makes that tagged conversation authoritative throughout correlation: live page signals, delivered receipts, pending receipts (across reloads) and draft matching only pair with rows from the same conversation, and delivery no longer waits for a row to establish identity or mute.

The existing page bridge, row fallback and dedupe stay in place as a safety net. Removing the text-matching code (phase 2) waits until this has run cleanly on all three platforms.

Idea from fMess (MIT); only the two short match patterns are copied.

Manual check needed before merge (not testable without a second session on Kris's account):

  • Carrier.log shows notify.page-enabled, then notify.fired and notify.identity for new messages while the window is hidden or unfocused.
  • No message notifies twice (page + fallback).
  • Group chats, encrypted chats and muted chats behave as before; check whether Messenger itself already skips muted conversations.

Ref [#351]

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

Related

Tickets: #351
Tickets: #394

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-07T17:02:04.075339Z">2026-11-07T17:02:04.075339Z</relative-time> | `373a0ca` | 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. What shall we delve into next?

    Reviewed commit: 373a0caff6

    ℹ️ 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 384.

     

    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.