First, the close() call was wrong, because the RFC expects a close reason in the 1000-1999 range, but we were passing 200.
I confirmed that changing to 1000 properly closes the socket, and cleans up the connection (which was otherwise causing a memory leak because it didn't close properly).
This also adds the userInitiated boolean to the onLiveQueryClientDisconnected() callback, so that listeners can choose how to respond based on if it was expected or not (an error disconnect may mean it needs to be reconnected; while an expected disconnect() close should not auto-reconnect)
First, the close() call was wrong, because the RFC expects a close reason in the 1000-1999 range, but we were passing 200.
I confirmed that changing to
1000
properly closes the socket, and cleans up the connection (which was otherwise causing a memory leak because it didn't close properly).This also adds the
userInitiated
boolean to theonLiveQueryClientDisconnected()
callback, so that listeners can choose how to respond based on if it was expected or not (an error disconnect may mean it needs to be reconnected; while an expected disconnect() close should not auto-reconnect)