The session handler is set up before opening the connection as instructed in the documentation.
The scenario that I want to handle is when a session token is expired or revoked, so I could request for a new session token and call
onSuccess in the
Currently none of the events are triggered when I revoke the token, or when I purposely issue a short-lived token and wait for it to expire.
What I noticed is, both these scenarios (revoked or expired token) triggers the
onReconnectStarted event instead, but that’s not what I need, as it will only keep on retrying to connect which fails because the token is no longer valid.
Any idea what could be the issue?
Hi @Tyler, would like to know if this has been fixed? Thanks!
We’ve completed the work internally and are just waiting for it to be released. I’ll post here when the version that includes the fix has been released. I apologize for the delay!
Hi @hewong Good news, this was released in version 3.1.10 which was released today. Please give it a try and let me know if you’re running into any issues.
Thanks for the update @Tyler, will give it a try!
Hi @Tyler , I’ve upgraded to v3.1.10 and tried the session handlers again.
From what I understood from the documentation (correct me if i’m wrong),
onSessionTokenRequired should be triggered when a session token expires during a session, so I could request a new session token and pass it into the
onSuccess callback to refresh the session.
This is what I did:
- set up session handlers
- connect to sendbird with a valid session token
- wait for session token to expire
onSessionTokenRequired to be triggered when the token expires, but
onSessionError was triggered instead.
Did I understand the handlers correctly or did I miss anything here?
Could you share with me some code examples on how you’re implementing the sessionHandlers? Feel free to DM me if you’d prefer.
Hi @Tyler , I am on sdk version 4.0.3 and still experiencing the same issue. Please check the following snippet. The
onSessionRequired never gets called when a session expires.
I’ll look at this as soon as possible and let you know what I find.
Just a quick update. I was able to reproduce the behavior and am working with our Engineering team to address it.