Description
- Operating System: Debian
- Node Version: v11.6.0
- NPM Version: 6.5.0
- webpack Version: 4.28.3
- webpack-dev-server Version: 3.1.14
- This is a bug
Code
You can see the problem here:
https://github.com/webpack/webpack-dev-server/blob/v3.1.14/client-src/default/socket.js
Expected Behavior
An exponential increase in time between reconnects with the sockjs server.
Actual Behavior
As you can see in the code I linked, the method onopen
resets the retries
variable to 0, so retries is always 0, and onclose
always tries to reconnect waiting the minimum time. Therefore the 'infinite logspam' solution doesn't work and people experience what is depicted in #1604
Also, here (from #1604 as well):
How can we reproduce the behavior?
Make the sockjs server close the connection (for example because the client has a bad origin header), the client will try to reconnect forever without respecting the intended timeout.
It is obvious looking at the code anyway.
PR
I've already submitted a PR.