The socket close event handler appears to have a bug in it. As far as I know, the only acceptable first parameter to Array::splice is a Number (as opposed to an object as seen in line 65 of index.js.)
Specifying an object as the first parameter appears to always splice the first element off. This pull request fixes this issue by using Array::indexOf to look up the index of the socket first.
Some steps to illustrate this bug:
Start your brunch server.
Load up the page in Chrome.
Load up the page in Firefox.
Make a change and see that both browsers refresh.
Close Firefox. This will cause Chrome's socket to to be popped off of the conns array instead of Firefox's.
Make a change and see that Chrome is no longer responding.
The socket close event handler appears to have a bug in it. As far as I know, the only acceptable first parameter to
Array::splice
is a Number (as opposed to an object as seen in line 65 of index.js.)Specifying an object as the first parameter appears to always splice the first element off. This pull request fixes this issue by using
Array::indexOf
to look up the index of the socket first.Some steps to illustrate this bug:
conns
array instead of Firefox's.