In this case, the delete op must also delete the annotation. If it didn't, the op wouldn't be invertable (if you apply the op then apply its inverse, you'll end up removing the annotation).
Your example should look like: mutation1 := anno('bold': 'true' -> NULL), delete 'ab', anno(end 'bold'), retain 2 mutation2 := retain 2, insert 'x', retain 2 After transform, mutation1_t is the same as you suggested, but mutation2_t := anno ('bold': NULL -> true) insert 'x', anno (end 'bold'), retain 2 ... and you get the correct behaviour. -J On Fri, Aug 6, 2010 at 11:14 AM, Torben Weis <torben.w...@gmail.com> wrote: > Hi, > > I encountered a problem while unit testing my OT code. Either I just found > a major flaw in the OT algorithm (i.e. a flaw that is almost impossible to > repair) or I am too tired to see the solution. Here is the problem: > > Let "A, B ,C" be BOLD letters, and "a, b, c" denote the same letters, but > not in bold. > Now imagine a simple document with the content > > doc := ABcd > > i.e. "ab" in bold and "cd" not in bold. Now two users edit the document > concurrently. > > mutation1 := delete:2, retain:2 > mutation2 := retain:2, insert:"x", retain:2 > > i.e. user1 sees "cd" and user2 sees "ABXcd". Notice that the "x" is bold -> > "X", because in word processors you inherit the style from the left. This is > important here! > > Now I transform both mutations and I get: > > mutation1_t := delete:2 retain:3 // I skip the inserted "x" -> > therefore retain2 > mutation2_t := insert"x", retain:2 // No need to skip "AB", because they > are already deleted > > Now user1 one applies mutation2_t and user2 applies mutation1_t. They > should end up in the same state. > > However, in the end user1 sees "xcd" and user2 sees "Xcd". The difference > is that x is not consistently annotated. > > As far as can see right now, the transformation function cannot do anything > because it needs style annotation that is only in the document but not in > the mutations. > > I hope that someone can enlighten me here, because otherwise the OT > algorithm is broken. > > Greetings > Torben > > -- > You received this message because you are subscribed to the Google Groups > "Wave Protocol" group. > To post to this group, send email to wave-proto...@googlegroups.com. > To unsubscribe from this group, send email to > wave-protocol+unsubscr...@googlegroups.com<wave-protocol%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/wave-protocol?hl=en. > -- You received this message because you are subscribed to the Google Groups "Wave Protocol" group. To post to this group, send email to wave-proto...@googlegroups.com. To unsubscribe from this group, send email to wave-protocol+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/wave-protocol?hl=en.