Closed Bug 1604219 Opened 6 years ago Closed 4 years ago

Twitch.tv Chat Messages Delayed/Reloads/Missed

Categories

(Core :: Networking: WebSockets, defect, P2)

71 Branch
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jimbo2150, Unassigned)

Details

(Whiteboard: [necko-triaged])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

Opened a live video in Twitch.tv

Actual results:

Periodically (not all the time) the Twitch chat will become delayed or get "disconnected" repeatedly. For live streams that show the chat in the video I will see new chat messages appearing even though they do not appear in the chat box on the screen. This will last typically between 2-10 minutes before the chat will "reconnect." In most cases the previous chat messages will suddenly pop into the box (though with incorrect timestamps since they were sent earlier but only now being shown). In other cases a "Reconnecting to chat..." message will appear for a few seconds then new messages will appear but older messages that were sent will not appear in the box. Refreshing the tab will fix the issue for a period of time but will eventually happen again after a random period of time.

In some cases I can send my own chat message and after a few seconds it will cause the chat server to reconnect but in other cases the message will remain in the input box and will only allow me to send it once the chat server is reconnected.

This issue only started in the past few versions of Firefox up to the current 71. The issue does not happen in Chrome (unless the chat server is experiencing issues which is rare) while the issue occurs in Firefox rather regularly.

I have seen a few live streamers that also use Firefox for their chat and have experienced similar issues where the chat gets regularly disconnected and must reload the Firefox tab.

Expected results:

The chat messages should continually update as they are sent and received from the server.

Setting Product and component.
Audio/Video: Playback team if this is not the right component please feel free to route this ticket to the corresponding team, thanks!

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

I guess it relates to WebRTC more.

Byron, is this something relating to data channel?

Component: Audio/Video: Playback → WebRTC
Flags: needinfo?(docfaraday)

Hi Jim,

Would you mind checking if this happen in Firefox Nightly?

Flags: needinfo?(jimbo2150)

I am not sure how chat is implemented in twitch, but datachannel seems plausible.

Flags: needinfo?(docfaraday)

Haven't used it long but I have not seen it happen on nightly yet.

Flags: needinfo?(jimbo2150)

Hi Nico, could you please take a look at confirming this and determining whether or not twitch uses data channels for this?

Flags: needinfo?(na-g)

It doesn't look like Twitch uses DataChannels. I am moving this over to WebSockets for now.

Component: WebRTC → Networking: WebSockets
Flags: needinfo?(na-g)

(In reply to Nico Grunbaum [:ng] from comment #7)

It doesn't look like Twitch uses DataChannels. I am moving this over to WebSockets for now.

Yeah it seems it uses WebSocket, at least in its javascript chat-sample.

I guess it's a websocket connection to irc-ws.chat.twitch.tv. When you see the problem, is there an active websocket connection visible at about:networking#websockets? Does developer tools show any messages for that websocket channel?

Flags: needinfo?(jimbo2150)

Yes, I see websocket connections happening in the about:networking and in web developers. I have not seen it happen on nightly or stable for a while now so I was not able to capture it. It is possible it was some script bug that Twitch has now fixed.

Flags: needinfo?(jimbo2150)

I'm closing it as WFM for now. Feel free to reopen it if you see it again.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME

This issue is happening again since upgrading to Firefox 73.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WORKSFORME → ---

Please can you test again with Firefox Nightly?

Flags: needinfo?(jimbo2150)

Andy,
I will try it in nightly in the next couple days.

Not sure if it helps but I watched the WebRTC connections in dev tools when it happened and it seems like it just got disconnected. Maybe it hit some sort of timeout? There was no error message, the connections just stopped. Sometimes sending a new chat message will "kick" it back on and I will see a "Connected to chat" message, but other times I will not. For the most part, sending a chat message will still send it even though I see no inbound chat messages (outbound only). It doesn't seem to happen for chat that is very active (at least not seen it happen in 73 yet). It seems to be when there is a lack of messages for a bit.

I got screen captures of an error message and the chat WebRTC messages after it happened on 73.0.1. I will try with Nightly later today.

https://photos.app.goo.gl/Wm1vb73q6pDubAwS6

When I try it on Nightly it does disconnect, though not as much as in 73, but every time it did it created a second connection and was reconnected about 10 seconds after a disconnect.

Flags: needinfo?(jimbo2150)

Michal, can you take a look?

Flags: needinfo?(michal.novotny)
Priority: -- → P2
Whiteboard: [necko-triaged]

Jim, can you please try to reproduce the failure with logging enabled? See https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging. The log modules should be "timestamp,sync,nsHttp:5,nsSocketTransport:5,nsWebSocket:5".

Flags: needinfo?(michal.novotny) → needinfo?(jimbo2150)

Michal,
Here is a log. The disconnect happened near the end followed by a false re-connect. False reconnect is when the chat says it reconnected but I still don't get any further messages unless I reload the page.

https://send.firefox.com/download/4799bcd97f2b0b05/#EzfvzsRyC1KzSZNwporYJw

Flags: needinfo?(jimbo2150)

Hi Jim,

Are you still able to reproduce this?
If yes, could you kindly provide the log again?

Thanks!

Flags: needinfo?(jimbo2150)

No, it no longer happens in the newer versions of Firefox.

Flags: needinfo?(jimbo2150)
Status: REOPENED → RESOLVED
Closed: 6 years ago4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.