Skip to content

about allowReconnection method, how to get a newer reconnectionToken #834

Closed Answered by endel
VicentGogh2025 asked this question in Q&A

You must be logged in to vote

Hi @VicentGogh2025, when the allowReconnection() resolves, you'll receive the new client instance. The new client instance has the new reconnection token.

this.allowReconnection(client, 6000).then((newClient) => {
  // the reconnection has been reestablished here
  console.log("new reconnection token: ", newClient._reconnectionToken);
}).catch(() => {
  console.log("reconnection failed:", client.sessionId);
});

On the new version 0.16, the ._reconnectionToken property has been renamed simply to .reconnectionToken - also, for convenience, the previous client instance will have its .reconnectionToken property updated after the reconnection is successful for easy access. (See sources)

Replies: 2 comments 1 reply

You must be logged in to vote
1 reply
@VicentGogh2025

Answer selected by VicentGogh2025

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants