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

perf: Don't send mutations for updates originating from this provider. #35

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

grgbkr
Copy link

@grgbkr grgbkr commented Dec 15, 2023

If we don't do this then when a provider receives an update from the server it does not yet have and applies it to the document it resends this update in a mutation to the server which then pokes it out to all other clients. The loop stops there as the clients all already have the update and so don't emit it again. Echoing the update back and sending no-op pokes is inefficient, so don't do it.

See yjs/yjs#321 (comment)

@grgbkr grgbkr requested a review from arv December 15, 2023 19:11
Copy link

vercel bot commented Dec 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
reflect-yjs-tiptap ✅ Ready (Inspect) Visit Preview Dec 15, 2023 7:11pm

@grgbkr grgbkr merged commit 1dc50cf into main Dec 15, 2023
7 checks passed
@grgbkr grgbkr deleted the grgbkr/update-optimizations branch December 15, 2023 19:15
Copy link

@arv arv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

2 participants