You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CollaborationExtension registered at runtime installs no sync plugin, so edits never reach the Y.Doc #3175
Collaboration registered on an editor that already exists doesn't sync. The editor becomes editable, typing works locally, and nothing is written to the Y.XmlFragment, so edits are silently lost.
We create a read-only editor without collaboration (fed a static snapshot, no provider). When the user switches to editing, we attach collaboration to that same editor instead of remounting it, which keeps scroll position and node views stable.
Cause (from reading the source)
ExtensionManager.replaceExtension installs the ProseMirror plugins of the extension it is given, but not those of that extension's nested blockNoteExtensions. For CollaborationExtension, the nested ones carry the actual plugins: YSync, YCursor, YUndo and the rest. So none of them are installed.
Workaround
Registering the sub-extensions flat works, in this order (the cursor plugin reads the sync plugin's state in its init):
YSync
YCursor
YUndo
ForkYDoc
RelativePositionMapping
SchemaMigration
FixUpSchemaExtension is not exported, so it can't be registered that way.
Repro
Create an editor without the collaboration option.
Register CollaborationExtension at runtime, with a Y.XmlFragment and a provider.
Type in the editor.
The fragment stays empty, and other clients see nothing.
Expected
Either nested blockNoteExtensions are installed when an extension is registered at runtime, or registering an extension whose nested extensions can't be installed throws instead of failing silently. A documented way to attach collaboration to an existing editor would also help.
Activity