תוסף הצ'אט לא מבין מיקוד בלשונית

סיכום מבוסס בינה מלאכותית

A bug has been reported in the Discourse chat plugin where notifications and unread counts fail to persist when the browser tab is not focused. SkyeDragon details that when User A has the chat open in a background tab and receives a message, the title bar briefly displays “(1)” before disappearing, and no desktop OS notification appears. However, if the chat is closed but Discourse remains open in a background tab, notifications work correctly. davidb asks clarifying questions about tab focus, chat mode (drawer vs. full screen), and notification type. SkyeDragon confirms the issue occurs regardless of chat mode and clarifies that “desktop notification” refers to OS-level push notifications, not UI badges. In a follow-up post, SkyeDragon confirms the bug appears in both Firefox and Chrome, with Chrome showing erratic unread counts (e.g., “(3)” → “(2)”). Delays of up to 30 seconds are also observed, possibly tied to polling intervals or network latency. A video demonstration is attached, highlighting the issue at 0:08 (Firefox), 0:32 (Chrome), and 0:50 (slow update). The core issue is that the plugin does not respect tab visibility for notification persistence or delivery.

Basically, the chat plugin doesn’t factor in whether the browser tab is currently focused/active.

Impact

Lost notifications and missing unread count in title bar.

Repro steps

Tested in firefox on latest 3.5.0.beta2-dev

  1. User A + B is logged into discourse and DMing each other using chat plugin.
  2. User A has the chat open, but in another tab.
  3. User B sends message to user A.
  4. User A’s tab briefly shows “(1)” to show the new message but quickly hides it one second later.
  5. User A does not receive a desktop notification.

Note: If User A does not have the chat window open but is otherwise still on discourse, the (1) in titlebar remains correctly and a system notification is displayed.

Expected behavior

If the tab isn’t visible/focused (whether that’s because it’s tab #29 or buried behind several other windows), as a user I want to receive notification.


Thank you!

2 לייקים

Hi, thanks for the report.

I have a few questions that will help with debugging.

  • In this situation, is Discourse open in the tab that has focus (without chat open)?

  • Are you using full screen chat or drawer mode?

Is the desktop notification in this case the green badge on the chat icon? Or something else?

לייק 1

No problem:

For User A, the browser’s focused tab is something else (ex: google). Inside the discourse tab, which is not browser focused, the chat is open.

I am 90% sure I saw this in both scenarios, but I’ll have to go back and re-test to know for sure which one (replying now so I can share the other info at least right away)

Desktop notification is the push notification that comes through the OS.

לייק 1

Update, I confirmed that it occurs in both the full screen and drawer mode.

The behavior is also different in chrome – it shows a (3) that then goes down to (2).

Also in both browsers, it sometimes just doesn’t go through for 30 seconds (until the next poll request according to network debugger). But maybe that part is just an internet connection problem

I took a video demonstrating the problem, attached:

  • 0:08 Firefox receive issue
  • 0:32 Chrome receive issue
  • 0:50 Slow update issue