0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 20:29:55 +08:00
discourse/plugins/chat/app/jobs
Kris 0d45f20935
FIX: improve the reliability of chat sounds (#41373)
Currently chat notification sounds can fail to play when every Discourse
tab was hidden, replayed for the same message when switching to another
tab of the same site (each tab decided independently when the backlog
reached it), and piled up in never-interacted tabs and played on the
first click.

This change answers the requesting tab as primary when no tab is focused
or visible, dedupes alerts across tabs with a short-lived localStorage
containing `chat_message_id`, and drops a sound instead of queuing it
when the audio context is suspended.

It also allows `isPrimaryTab()` to ignore unrelated service worker
messages and fails open after 1s instead of hanging forever.

New tests are included to avoid regressions.
2026-07-02 18:52:41 -04:00
..
regular/chat FIX: improve the reliability of chat sounds (#41373) 2026-07-02 18:52:41 -04:00
scheduled/chat FEATURE: Pin chat messages (#37985) 2026-02-23 22:00:16 +01:00