Reconnect handling
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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