hocuspocus icon indicating copy to clipboard operation
hocuspocus copied to clipboard

Should provider.disconnect() reconnect automatically?

Open dkrym opened this issue 5 years ago • 4 comments

Description Hey, when I call provider.disconnect(), provider immediately reconnects back. Is this intended or is it a bug?

​I would swear I used provider.disconnect() before to manually disconnect from server without provider trying to reconnect again (as disconnect method set shouldConnect to false).

Steps to reproduce the bug Steps to reproduce the behavior:

  1. connect to server
  2. call provider.disconnect() from frontend

Expected behavior I would expect that calling provider.disconnect() disconnects without retry and that I have to call provider.connect() manually.

Environment? ​- operating system: Win10 ​- browser: Chrome, FF ​- mobile/desktop: Desktop ​- hocuspocus version: @hocuspocus/[email protected]

Additional context Add any other context about the problem here.

dkrym avatar Sep 16 '21 06:09 dkrym

That’s a bug! It shouldn’t reconnect then. Thanks for reporting!

hanspagel avatar Sep 16 '21 07:09 hanspagel

Thanks, just to provide more info, it is not only a problem of disconnect(). Same thing happens when you call provider.destroy() (which is not a surprise as destroy calls disconnect()). Provider v14 is ok so I believe it is problem introduced with new reconnection system.

Anyway, just wanted to warn people to stay on v14 until resolved as the connections are never fully terminated (until page refresh)

dkrym avatar Sep 19 '21 04:09 dkrym

Experiencing the same issue!

jpamorgan avatar Sep 27 '21 15:09 jpamorgan

Thanks @tommoor! Released as @hocuspocus/provider 1.0.0-alpha.17. ✌️

hanspagel avatar Oct 05 '21 20:10 hanspagel