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
There is a problem with transforming collapsed ranges. I have a feeling that we already discussed it, but I am not sure whether we discussed this case exactly.
You probably remember an issue, a long time ago, range was incorrectly transformed when it was collapsed and nodes were inserted at that position: foo[]bar --> foo]xxx[bar.
Not only the range got expanded but also the boundaries were reversed.
This was fixed so that when range is collapsed, it doesn't get expanded and it goes after the inserted content: foo[]bar --> fooxxx[]bar.
But this is incorrect in OT, when the range is "sticky". This creates problems when transforming MergeDelta by MergeDelta. Since the move operation is "sticky", the nodes inserted next to range should be included. So what we expect in this case is: [] -> [xxx] instead of [] -> xxx[].
So I propose that instead of ignoring isSticky for collapsed comment, we handle it correctly. Of course with isSticky == false, we go with current handling, so foo[]bar becomes fooxxx[]bar.
The text was updated successfully, but these errors were encountered:
I've checked tests and as far as unit tests goes, this change affect just one test, which checks exactly the outcome, so it seems that in unit tests we never use collapsed range + isSticky = true.
There is a problem with transforming collapsed ranges. I have a feeling that we already discussed it, but I am not sure whether we discussed this case exactly.
You probably remember an issue, a long time ago, range was incorrectly transformed when it was collapsed and nodes were inserted at that position:
foo[]bar
-->foo]xxx[bar
.Not only the range got expanded but also the boundaries were reversed.
This was fixed so that when range is collapsed, it doesn't get expanded and it goes after the inserted content:
foo[]bar
-->fooxxx[]bar
.But this is incorrect in OT, when the range is "sticky". This creates problems when transforming
MergeDelta
byMergeDelta
. Since the move operation is "sticky", the nodes inserted next to range should be included. So what we expect in this case is:[]
->[xxx]
instead of[]
->xxx[]
.So I propose that instead of ignoring
isSticky
for collapsed comment, we handle it correctly. Of course withisSticky == false
, we go with current handling, sofoo[]bar
becomesfooxxx[]bar
.The text was updated successfully, but these errors were encountered: