coast-team / netflux

JavaScript client and server side transport API based on WebRTC & WebSocket
https://coast-team.github.io/netflux
GNU Affero General Public License v3.0
213 stars 14 forks source link

LEAVING WebGroup state #117

Closed kalitine closed 6 years ago

kalitine commented 6 years ago

Leaving the WebGroup is an async process, thus the LEAVING state (state between JOINED and LEFT) might be useful. For example it was useful in the case when the browser (by error) thinks that it is offline and then back online just after. The sequence of events are as follow:

Browser: OFFLINE Netflux: calls leave(), but is still in JOINED state. Browser: ONLINE Netflux: Check the state... JOINED, so no reconnection needed Netflux: finish leaving, the state is LEFT (here is the problem: Netflux should reconnect, as the browser is back online, but it does not)