Repository navigation
fix: only load editor once even if connection is recovered - #3868
Conversation
|
This PR includes a test that cancels some requests to simulate a connection loss. |
|
We will need to work on the TODO items listed above. However I think it would still be good to land this today before the RC to mitigate some of the problems we are seeing on the server right now. |
1 flaky tests on run #8812 ↗︎Details:
|
|||||||||||||||||||||
| Test | Artifacts | |
|---|---|---|
| Open test.md in viewer > Share a file with download disabled shows an error |
Output
Screenshots
|
|
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.
5c47bb5 to
eb196e0
Compare
|
Okay... found a much simpler way of basically achieving the same. One issue remains though: |
|
/rebase |
`onLoaded` may be called multiple times. When the connection to the server is lost and restored the collaboration extension reloads the websocket polyfill which in turn opens the SyncService which will trigger the `onCreated` and `onLoaded` callbacks. Prevent duplicate editor the simple way - by checking if it exists already and only loading if it does not. Signed-off-by: Max <[email protected]>
eb196e0 to
32eeb94
Compare
|
/compile |
Signed-off-by: nextcloud-command <[email protected]>
mejo-
left a comment
There was a problem hiding this comment.
Code looks good to me 👌
I don't fully understand the impact of moving up the initialization of this.backend above the emits.
📝 Summary
Only load the editor if it has not been loaded yet.
MovecreateEditorout of theonLoadedfunction.onLoadedmay be called multiple times.When the connection to the server is lost and restored the collaboration extension reloads the websocket polyfill which in turn opens the SyncService
which will trigger the
onCreatedandonLoadedcallbacks.🚧 TODO
When loosing the connection the yjs websocket provider will try to reconnect automatically
However we still show the reconnect button. The automatic reconnection succeeded for me - but the button fails.
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)