-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reconnect() doesn't work #256
Comments
Hello thanks for reporting. We will see if we can replicate and report back. |
Thank you for looking into this. |
Here is what we are going to use: import * as Convergence from '@convergence/convergence';
function patchReconnect(domain: Convergence.ConvergenceDomain) {
// Patch Convergence Connection class to reconnect with the original JWT instead of a reconnect token.
// Reconnecting with a reconnect token appears to be broken atm:
// https://github.com/convergencelabs/convergence-project/issues/256
const connection = (domain as any)._connection;
connection.connectWithReconnectToken = connectWithReconnectToken;
}
function connectWithReconnectToken(this: any /* ConvergenceConnection */): Promise<void> {
const gen = this._connectionRequestGenerator;
return (gen
? this._connect(gen).catch((e: any) => this._handleReconnectFailure(e))
: Promise.reject(new Error('No connectionRequestGenerator! Have you connected even once before calling reconnect()?'))
);
} This function is called like this: Convergence.connectWithJwt(url, jwt, {...}).then(domain => {
patchReconnect(domain);
...
}); |
Thank you - works like a charm, as long as the JWT token is still valid. Is there a chance to get a hook to refresh the JWT token while convergence tries to reconnect ? |
Versions
Please fill in all that apply:
Describe the Bug
Convergence.reconnect(url,reconnectToken) never returns either a domain nor an error.
Step To Reproduce
A code snippet or gist to reproduce the issue will greatly improve our response time
please see: https://github.com/thomaskahabka/convergence_test for a vuejs test application.
Expected Behavior
reconnect() to return a domain, as was working in rc7
The text was updated successfully, but these errors were encountered: