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

Reconnect handling #4943

Open
juliusknorr opened this issue Oct 31, 2023 · 3 comments
Open

Reconnect handling #4943

juliusknorr opened this issue Oct 31, 2023 · 3 comments
Labels
bug Something isn't working feature: sync

Comments

@juliusknorr
Copy link
Member

I noticed when testing #4938 that there seems to be a case when a connection is offline long enough that the reconnect is not working as expected.

When trying to address the issue there by dropping the disconnected websocket provider with the following patch I noticed that after reconnecting the offline client would no longer send changes while still picking up the ones from the other clients.

diff --git a/src/components/Editor.vue b/src/components/Editor.vue
index 407004d99..879928d03 100644
--- a/src/components/Editor.vue
+++ b/src/components/Editor.vue
@@ -423,6 +423,7 @@ export default {
                reconnect() {
                        this.contentLoaded = false
                        this.hasConnectionIssue = false
+                       this.$providers.forEach(p => p.destroy())
                        this.close().then(this.initSession)
                        this.idle = false
                },
@juliusknorr juliusknorr added the bug Something isn't working label Oct 31, 2023
@juliusknorr
Copy link
Member Author

Actually seems like after the reconnect the step is not pushed at all so we have a diverging state between both clients

Failing step:
Screenshot 2023-10-31 at 15 23 16

First successful push after reconnect:
Screenshot 2023-10-31 at 15 23 46

@juliusknorr
Copy link
Member Author

#5082 was an attempt but unclear how it could have an effect, needs further debugging.

  • Clarify state behaviour of Editor.vue and related components (sync service, connection, websocket polyfill) in the lifecycle of editing especially with reconnect, what objects are reused, recreated, are there any leftovers still active?
  • @max-nextcloud Looking into preserving the queue from one websocket polyfill instance to another
  • Try commenting out the code part that makes the editor read only for easier debugging
  • See if applying the document state again after reconnect causes troubles (maybe rather just sync the steps instead?)

@juliusknorr
Copy link
Member Author

Idea:

  • for easier debugging try to add buttons locally to disconnect or reconnect in editor.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature: sync
Projects
Status: 🧭 Planning evaluation (don't pick)
Development

No branches or pull requests

2 participants