Repository navigation
fix(editor): prevent content loss during collaborative initialization - #100
Merged
Merged
Conversation
Signed-off-by: Leo Stehlik <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent a fresh collaborative editor from erasing existing page content during initialization. A provider's
syncedcallback can occur while the editor view is still stale; even a no-op initial ID transaction can trigger a destructive Yjs write.Verification
Based on the current GitHub
master(ead85ed), with its frozen lockfile and Tiptap 3.30.5. No dependency/lockfile changes.pnpm test:editor-ext: 31/31 passed, including 10 real-editor/Yjs rich-content timing cases and 21 document/lifecycle guards.pnpm --filter server test --runInBand: 156/156 passed across 27 suites.NX_DAEMON=false pnpm exec nx run-many -t build -p client server @wrenlore/editor-ext --skip-nx-cache: all 3 production builds passed.git diff --check: passed.Tests use synthetic content only and do not connect to external services. Existing non-fatal bundle-size/dynamic-import and ts-jest warnings remain unchanged.
Scope
No database migrations, deployment changes, customer exports, credentials, environment-specific URLs, or importer artifacts are included. This is the permanent source-code fix; it does not redeploy any running instance.