-
Notifications
You must be signed in to change notification settings - Fork 937
Revert #4755 and fixes content duplicated. #4759
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
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 98c1306 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @felixfeng33's task —— View job Changeset Created ✅I've analyzed the PR and created the appropriate changeset: Changes Made:
Summary:This PR fixes a missing id parameter in the BaseYjsPlugin initialization. The plugin now:
The changeset has been committed to your PR branch and should now be picked up by the changeset bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // After sync, check if ydoc has content from server | ||
| const sharedRoot = ydoc.get('content', Y.XmlText) as Y.XmlText; | ||
|
|
||
| // Only apply initial value if ydoc is empty (no content from server) | ||
| if (sharedRoot.length === 0 && value !== null) { | ||
| let initialNodes = value as Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid overwriting synced custom shared types
After waiting for providers to sync, the code decides whether to seed the document by checking only ydoc.get('content', Y.XmlText).length === 0. When a custom shared type is supplied and already populated by the provider, the default content key remains empty, so this branch still runs and customSharedType.applyDelta re-seeds the doc, overwriting/duplicating the server state for custom shared types. The emptiness check should use the custom shared type (or skip seeding after a successful sync) to avoid data loss when custom shared types carry the actual content.
Useful? React with 👍 / 👎.
6476c4d to
98c1306
Compare
Checklist
yarn typecheckyarn lint:fixyarn testyarn brlyarn changeset