Originally created by: kristofferR
Every Carrier notification is reconstructed from the DOM. Carrier.log on both Kris's Mac and Omarchy shows notify.fired (a page-constructed Web Notification) 0 times, against 561 and 603 notify.fallback row-scrape firings. The comment in notifications.ts:736 says Meta "no longer reliably constructs Web Notifications".
Because of that, Carrier pairs titles and bodies against chat rows (notifications.ts:398-451, lib/notification-fallback.ts (github.com), about 1,650 lines), guesses the sender from a "Name:" prefix (lib/notification-names.ts:34), and harvests avatars from the DOM by display name (lib/sender-avatars.ts (github.com)). It never sees a stable message ID.
Messenger's useMWLSChatPopperUpper only raises a notification when isMessengerPWA() && justknobx._("1465") holds and the page is hidden. In Carrier neither condition is true, so Messenger never notifies.
Phase 1: make Messenger notify, and capture the real message.
blob: script and only applies the patch when the pattern matches exactly once; otherwise the original module runs unchanged (03-facebook-modules.js:128-153). Carrier should add the same guard and log a diagnostics line when the pattern stops matching.MWDesktopNotifications.triggerLocalNotification(db, message) (03-facebook-modules.js:84-103). The message row carries threadKey, senderId, timestampMs, and a messageId equal to the notification tag. From it:contacts and participants tables (14-notifications.js:36-60);getLSMediaContactProfilePictureLargeUrl and the group picture from getLSMediaThreadPictureUrl;tag (14-notifications.js:154-157);lastReadWatermarkTimestampMs (14-notifications.js:29-35).carrier:notify path and the cross-window notification ledger, keyed by tag. Keep the row fallback running as a safety net, suppressed for any message already delivered by tag.Phase 2: delete the guessing. Once Phase 1 has run cleanly on all three platforms, remove the text-correlation, name-prefix and DOM avatar-harvest code that it makes redundant. Keep the row fallback only if diagnostics show the hook missing messages.
Carrier already imports LSDatabaseSingleton and ReQL (notification-names.ts:115-123), so the database plumbing exists. The idea is reused from fMess (MIT); only the two short match patterns would be copied, with attribution.
notify.fired should now dominate notify.fallback in Carrier.log.Part of [#349].
Ticket changed by: kristofferR
Originally posted by: kristofferR
Landed in [#384]: Messenger raises its own notifications, keyed by message ID, and Carrier renders them natively.
It is on
mainand ships in the next release.Related
Tickets:
#384