-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix: Ensure WebsocketPolyfill always has the latest session state and version #6217
Conversation
fa8b1a5
to
e949dbc
Compare
… version Signed-off-by: Julius Härtl <[email protected]>
e949dbc
to
0d78119
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments to hopefully make the changes more clear
@@ -566,7 +566,7 @@ export default { | |||
}, | |||
|
|||
onSync({ steps, document }) { | |||
this.hasConnectionIssue = !this.$providers[0].wsconnected || this.$syncService.pushError > 0 | |||
this.hasConnectionIssue = this.$syncService.backend.fetcher === 0 || !this.$providers[0].wsconnected || this.$syncService.pushError > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This callback is triggering for either a successful sync or push request so we need this as a workaround way to check if the other request currently has issues.
syncService.open({ fileId, initialSession }) | ||
|
||
syncService.open({ fileId, initialSession }).then((data) => { | ||
if (syncService.hasActiveConnection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to refactor this slightly as we then can just always rely on the open method to return the relevant data, in both first connects and reconnects
/backport to stable30 |
Steps to reproduce
What happened
If the sync request was failing and the websocket polyfill was reinitialized there was no event emitted by the syncService to set the current session state, version on the new instance again. This lead to push requests missing the current version in the request data.