fix(super-editor): prefer collaboration bootstrap over local file init#2539
fix(super-editor): prefer collaboration bootstrap over local file init#2539harbournick wants to merge 1 commit intomainfrom
Conversation
5fff777 to
b5a2c38
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5a2c38915
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Collaboration startup must own room classification before we initialize | ||
| // from a local file source. Otherwise the editor can render local content | ||
| // while the shared room remains blank until a later async seed. | ||
| if (props.options.ydoc && props.options.collaborationProvider) { |
There was a problem hiding this comment.
Guard collaboration-first init for providers without events
Switching initializeData to prefer the collaboration path means sessions that pass both fileSource and collaboration options now always execute waitForSync, which unconditionally uses provider.on/off. Because CollaborationProvider allows those methods to be absent, an unsynced provider shim (or partial adapter) will now throw or hang before editor creation, and the local file never loads; this is a regression from the previous ordering where file-backed startup bypassed sync waiting. Please gate on the event API (or reuse the existing provider-sync helper) so this path cannot deadlock/crash.
Useful? React with 👍 / 👎.
No description provided.