ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

disconnected with self generated JWT token

Open step135 opened this issue 2 years ago • 2 comments

Never connected using generated JWT token. And there is no error fired to know the reason.

┆Issue is synchronized with this Jira Task by Unito

step135 avatar Apr 30 '23 11:04 step135

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3563

sync-by-unito[bot] avatar Apr 30 '23 11:04 sync-by-unito[bot]

Hey @step135, thanks for reaching out!

You can observe connection state by using the client.connection event emitter interface:

// The listener gets called every time the client connection state changes
client.connection.on(stateChange => {
  stateChange.previous // the previous connection state
  stateChange.current // the new connection state
  stateChange.reason // the error which caused the connection state to change, if any
});

You should be able to use this to observe which error is preventing the client from establishing a connection and diagnose your JWT problem accordingly. Let us know if this doesn't work or if you have any further issues.

owenpearson avatar May 02 '23 09:05 owenpearson

Closing this issue as it has been inactive for more than a year. If you are still experiencing issues with using JWT tokens in ably-js, please open a new issue.

VeskeR avatar May 22 '24 23:05 VeskeR