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
At the moment, there is a callback that adds <caption> to <image> whenever <image> without <caption> is inserted to the document. Unfortunately, there is a small bug in that fixer, which causes adding redundant <caption> (and it also makes the editor throw :P).
So the problem is when the change comes from OT (redo is taken care of because fixer checks type == 'insert'). Client A adds an image and generates <caption> using fixer.
Then on client B, first, you get the InsertOperation that inserts just the <image>. The fixer checks it and sees that empty <image> is added, so it adds the <caption>. But then you get the "fixer operation" from client A which adds additional <caption>.
There are two solutions possible.
In batch.document.enqueueChanges block, check if the <image> is still empty, before adding second <caption>.
Do not fix if batch.type is transparent.
I prefer 1 solution, at least for now. We haven't discussed how fixers and problems like this should be solved for OT yet (similar case will be with possible auto embed feature -- converted link should not be replaced twice).
The text was updated successfully, but these errors were encountered:
At the moment, there is a callback that adds
<caption>
to<image>
whenever<image>
without<caption>
is inserted to the document. Unfortunately, there is a small bug in that fixer, which causes adding redundant<caption>
(and it also makes the editor throw :P).So the problem is when the change comes from OT (redo is taken care of because fixer checks
type == 'insert'
). Client A adds an image and generates<caption>
using fixer.Then on client B, first, you get the
InsertOperation
that inserts just the<image>
. The fixer checks it and sees that empty<image>
is added, so it adds the<caption>
. But then you get the "fixer operation" from client A which adds additional<caption>
.There are two solutions possible.
batch.document.enqueueChanges
block, check if the<image>
is still empty, before adding second<caption>
.batch.type
istransparent
.I prefer 1 solution, at least for now. We haven't discussed how fixers and problems like this should be solved for OT yet (similar case will be with possible auto embed feature -- converted link should not be replaced twice).
The text was updated successfully, but these errors were encountered: