Skip to content

Commit

Permalink
fix(sync): Disable browser broadcast
Browse files Browse the repository at this point in the history
Ensure the browser broadcast does not lead to out of sync docs.

If a tab fails to send a step over the network
it may still distributes it to a different tab / window
via the browser broadcast.

That other window will include the step in the yjs history
without forwarding it to other parties.

From that point on all changes in the second tab
will depend on the step that other clients did not receive.

Therefore these changes will not be applied at other parties.

To prevent this scenario disable browser broadcast completely.

Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Sep 30, 2024
1 parent 719af45 commit 527fc31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ export default {
fileId: this.fileId,
queue: this.$queue,
initialSession: this.initialSession,
disableBC: true,
})
this.$providers.push(syncServiceProvider)
this.forceRecreate = false
Expand Down

0 comments on commit 527fc31

Please sign in to comment.