Skip to content
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

[stable26] Preserve queue during reconnects #5214

Merged
merged 6 commits into from Jan 9, 2024

Conversation

max-nextcloud
Copy link
Collaborator

@max-nextcloud max-nextcloud commented Jan 9, 2024

  • fix(sync): preserve queue if sendRemainingSteps fails
  • fix(sync): keep queue around during reconnects
  • fix(sync): ensure queue stays the same array
  • fix(sync): only clear queue after successful send
  • fix(sync): clear old providers on reconnect

During a network disconnect
Yjs-websocket notices missing awareness messages and closes the connection.
In this case the remaining steps can also not be send out and the request fails.
Preserve the queue so we can use it once the network is back up.

Signed-off-by: Max <max@nextcloud.com>
When yjs does not receive awareness updates
it will close and reopen the websocket.
Keep the content of the queue, i.e. the outgoing steps
so they can be send out once the connection is back.

Signed-off-by: Max <max@nextcloud.com>
Change the content of `queue` with `queue.splice`
rather than setting `queue` to another array.

Signed-off-by: Max <max@nextcloud.com>
Also add a unit test for the websocket polyfill

Signed-off-by: Max <max@nextcloud.com>
avoids the old provider leaking error events.

Signed-off-by: Max <max@nextcloud.com>
Copy link

cypress bot commented Jan 9, 2024

3 flaky tests on run #12416 ↗︎

0 150 2 0 Flakiness 3

Details:

backport/5126/stable26
Project: Text Commit: 9ba8c3c581
Status: Passed Duration: 04:04 💡
Started: Jan 9, 2024 11:48 AM Ended: Jan 9, 2024 11:52 AM
Flakiness  cypress/e2e/sync.spec.js • 3 flaky tests

View Output

Test Artifacts
Sync > saves the actual file and document state Screenshots
Sync > saves on close Screenshots
Sync > passes the doc content from one session to the next Screenshots

Review all test suite changes for PR #5214 ↗︎

@max-nextcloud
Copy link
Collaborator Author

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@juliushaertl juliushaertl changed the title backport/5126/stable26 [stable26] Preserve queue during reconnects Jan 9, 2024
@juliushaertl juliushaertl added this to the Nextcloud 26.0.11 milestone Jan 9, 2024
@juliushaertl juliushaertl merged commit 586e64f into stable26 Jan 9, 2024
34 checks passed
@juliushaertl juliushaertl deleted the backport/5126/stable26 branch January 9, 2024 14:07
@juliushaertl juliushaertl added the bug Something isn't working label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants