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

Emit event when missing structs to apply entire update #550

Open
max-nextcloud opened this issue Jul 6, 2023 · 0 comments
Open

Emit event when missing structs to apply entire update #550

max-nextcloud opened this issue Jul 6, 2023 · 0 comments
Assignees

Comments

@max-nextcloud
Copy link

max-nextcloud commented Jul 6, 2023

Is your feature request related to a problem? Please describe.
We're syncing yjs documents over the network. Sometimes a message is dropped and the corresponding update does not reach a party. All following updates cannot be applied and the changes from one party are not synced.
We could perform periodic resyncs - but if the interval is too big the parties would still be out of sync for a while. If it's too short the overhead of resyncs becomes too big.

Describe the solution you'd like
If yjs emitted an event whenever an update cannot be applied because a previous update is missing we could use that to trigger the resync when it is needed.

Describe alternatives you've considered
Being able to check if all updates have been fully applied on the ydoc would be another option.

Having both combined would allow for the following:

  • listen for the event to see if an update cannot be applied
  • wait for a few seconds in case messages just arrived out of order
  • check if all updates have been fully applied
  • resync if not

Additional context

We're syncing yjs docs via a legacy protocol that uses http requests. There's a lot we can do to make this more reliable and better suited for yjs. But for the time being a way to detect out of sync situations would be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants