UserExited is not triggered when we close browser

I used open channel, when i close tab of browser it will not call userExited or onChannelParticipantCountChanged but when i call createParticipantListQuery it will reflect userexited list.

Hi @Kishan_Radadiya,

Welcome to the Sendbird Community. This is expected behavior as these events are only triggered when the explicit exit() event is called. when a user simply closes the browser, and the websocket connection is closed, the exit() event is not called and thus the resulting events are not triggered.

1 Like

thank you I already used exit(), but forgot to add

window.addEventListener("beforeunload", ()=>{
channel.exit()
})

now it’s working fine.