lukeed / sockette

The cutest little WebSocket wrapper! 🧦
MIT License
2.45k stars 81 forks source link

Still reconnecting after close() #49

Closed raduciobanu22 closed 5 years ago

raduciobanu22 commented 5 years ago

I just tested v2.0.5 and unfortunately the issue is still there. This is my scenario:

  1. Open WS connection A.
  2. Close WS connection A.
  3. Open WS connection B.
  4. Close WS connection B.
  5. Open WS connection C.

After a while WS connections A and B are reopened. They are initially closed, but re-opened.

lukeed commented 5 years ago

v2.0.5 does not include 66bf604 – I've not published a new version yet.

If you could paste in the most recent code from master & test it out, that'd be appreciated

raduciobanu22 commented 5 years ago

Sure, give me a sec.

raduciobanu22 commented 5 years ago

Problem still seems to be there. This is the scenario:

  1. Open WS connection A.
  2. Close WS connection A.
  3. Open WS connection B.
  4. Close WS connection B.
  5. Open WS connection C.

Another interesting aspect is that calling close() does not trigger the onclose callback. But after a while (10+ seconds) I am seeing that callback being triggered and the code is 1006. Right after that the connections that were previously closed are reopened one by one.

raduciobanu22 commented 5 years ago

@lukeed Ignore my previous comment. The issue is fixed. It does not reconnect anymore after calling close(). The last part with the onclose callback being called with code 1006 is still there but the main issue is fixed.

lukeed commented 5 years ago

Cool, thanks

I need a repro for the second half. Sounds like #29 Way too many variables involved. Servers can be acting up, the action you take on client side can be interpreted any number of ways, etc