client-sdk-unity
client-sdk-unity copied to clipboard
Inconsistent Firing of Disconnect Events Across Disconnection Paths
Currently, the Disconnected event does not consistently fire across all disconnection paths. Specifically, when disconnection occurs through the DisconnectReceived callback, the event is not triggered at all.
Moreover the disconnect event should be fired with a DisconnectReason, currently it passes the room instead.
Proposed Solution:
- Introduce a
DisconnectDelegatethat includes aDisconnectReason. - Update the
Disconnectedevent to use this new delegate. - Ensure that the
Disconnectedevent fires with a reason when disconnection occurs via theDisconnectReceivedcallback.
Looking at the enum for DisconnectReason I am not sure which one is the best in this case. I will make a PR using ClientInitiated, but this is arbitrary and can/should be revised as needed.