Menu ▾ ▴

#5 Unread Dock/taskbar badge doesn't appear

closed
nobody
None
2026-06-29
2026-06-28
Anonymous
No

Originally created by: kristofferR

Symptom

With one unread conversation, no badge appears on the Dock icon.

How it's supposed to work

unreadBadge in src-tauri/inject/messenger.js watches document.title for the unread count Facebook puts there (e.g. (1) Messenger), parses \((\d+)\), and calls plugin:window|set_badge_count with the count (or null to clear). It also emits carrier:unread for the tray tooltip.

Verified correct

  • Command set_badge_count(Option<i64>) and permission core:window:allow-set-badge-count (in capabilities/default.json) match Tauri 2.10.
  • Default unread_badge setting is true.
  • The module runs (__TAURI_INTERNALS__ present), with a <title> MutationObserver + a 15s interval + a carrier:settings listener.

Most likely cause (to confirm)

Facebook's facebook.com/messages document.title may not carry the (N) count in the state being observed — e.g. it's only present when the tab is backgrounded, or the format differs from messenger.com. If so, the regex finds nothing → count = 0 → no badge.

Next step

Use the new tauri-mcp dev tooling (execute_js) to read document.title (and the unread DOM) in the logged-in app and confirm whether (N) is present. If the title is unreliable, switch to DOM-based unread detection (count unread conversation rows / FB's own unread indicator) instead of the title.

Repro

  1. Have ≥1 unread conversation in Messenger.
  2. Open Carrier (Dock-visible, not menu-bar-only mode).
  3. Expected: Dock badge shows the count. Actual: no badge.

Related

Tickets: #11
Tickets: #13
Tickets: #32

Discussion

  • Anonymous

    Anonymous - 2026-06-29

    Originally posted by: kristofferR

    Fixed and merged via [#11] (now on main). There were two root causes, both addressed and verified end-to-end (Dock badge read back from the OS):

    1. Wrong IPC argument name. messenger.js called plugin:window|set_badge_count with { count: n }, but Tauri's setter! macro names the argument value, so the count was always dropped and the badge cleared on every update. Now sends { value: ... }.
    2. Missing macOS badge authorization. Since macOS 12, setBadgeLabel: is silently ignored unless the app has requested UNUserNotificationCenter authorization with the badge option. Carrier now requests it once on RunEvent::Ready via request_badge_authorization (granted silently, no prompt).

    PR [#11] also added a badge-count mode setting (unread messages vs. unread conversations) and made the badge reload-safe. Closing as resolved.

     

    Related

    Tickets: #11

  • Anonymous

    Anonymous - 2026-06-29

    Ticket changed by: kristofferR

    • status: open --> closed
     

Log in to post a comment.