nextcloud / nextcloud/text

Reconnect handling

Open
#4,943 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: sync
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

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
                },

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with reconnect() in src/components/Editor.vue and reproduce the long-offline scenario described in the issue. Compare behavior with and without destroying the disconnected websocket providers, then verify that a reconnected client both receives changes and sends its own changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
distributed-systems, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.