fix: Ensure WebsocketPolyfill always has the latest session state and version#6217
Merged
juliusknorr merged 1 commit intomainfrom Aug 19, 2024
Merged
fix: Ensure WebsocketPolyfill always has the latest session state and version#6217juliusknorr merged 1 commit intomainfrom
juliusknorr merged 1 commit intomainfrom
Conversation
fa8b1a5 to
e949dbc
Compare
… version Signed-off-by: Julius Härtl <jus@bitgrid.net>
e949dbc to
0d78119
Compare
juliusknorr
commented
Aug 16, 2024
Member
Author
juliusknorr
left a comment
There was a problem hiding this comment.
A few comments to hopefully make the changes more clear
|
|
||
| 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 |
Member
Author
There was a problem hiding this comment.
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) { |
Member
Author
There was a problem hiding this comment.
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
This was referenced Aug 16, 2024
blizzz
approved these changes
Aug 19, 2024
Member
Author
|
/backport to stable30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.