'WebSocket messages not received on the client when throttling. Issue is present in Chrome, but not in Firefox

I recently built a real-time application that uses a CRDT algorithm on the back-end, and WebSockets to communicate. Since I had a strong connection 99% of the time, I haven't noticed any effects of the problem, but some customers have reported issues with syncing.

I traced these issues back to Chrome not accepting WebSocket messages. To reproduce their environment, I used the throttling feature. Despite having seen several issues in the past where throttling wouldn't work with WebSockets in DevTools, for me it worked. The syncing was slowed down at first until it fully stopped. Here's how the transfer looks.

transfer

In Firefox this doesn't happen, even when I throttle down to incredibly low speeds.

I checked the server, and messages are received successfully and outgoing messages are apparently sent, with no errors.

After a while, because the web application receives no message, hence no "ping" message either, it doesn't "pong" back, and the connection eventually gets terminated.

I can provide code samples if they are needed, but here it seems like the problem lies elsewhere.

I use the "ws" module on the back-end.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source