CollaborationExtension registered at runtime installs no sync plugin, so edits never reach the Y.Doc
Les mainteneurs répondent en général sous 2 jours
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- react, typescript
Piste de recherche
Start in ExtensionManager.replaceExtension, which installs the plugins of the extension passed in but skips its nested blockNoteExtensions; CollaborationExtension is where YSync, YCursor and YUndo live. Reproduce by creating an editor without the collaboration option and registering CollaborationExtension at runtime, then check whether the Y.XmlFragment changes after typing. Done means nested extensions are installed on runtime registration, or registration throws when they cannot be.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Version: BlockNote 0.55 (@blocknote/core, @blocknote/react)
What happens
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
collaborationoption. - Register
CollaborationExtensionat runtime, with aY.XmlFragmentand 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.
- Langage dominant
- TypeScript
- Étoiles
- 10.3k
- Forks
- 778
- Merge moyen
- 2 j 12 h
- PR mergées (30 j)
- 27
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TypeCellOS/BlockNote
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
TypeCellOS/BlockNote#2949 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
a11y
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
TypeCellOS/BlockNote#2855 ·
Les mainteneurs répondent en général sous 2 jours
-
a11y
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
TypeCellOS/BlockNote#2829 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Comment thread actions: hover-only controls and unlabeled buttons in ThreadsSidebaPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertea11y
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
TypeCellOS/BlockNote#2824 ·
Les mainteneurs répondent en général sous 2 jours
-
needs-triage
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
TypeCellOS/BlockNote#3165 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de TypeCellOS/BlockNote
Issues similaires
-
bug cli service
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
create-element: same editorAlias silent-fallback bug as #201, not covered by that fixPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertegenerated-by-ai
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
umbraco/Umbraco-CMS-MCP-Editor#208 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Table: Space fires onActivate in single-selection mode — the reference doc and the JSDoc disagreeOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
sidorares/react-x11-components#764 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
backnotprop/plannotator#1840 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
JoviDeCroock/pracht#432 ·
Les mainteneurs répondent en général sous 1 jour