nytimes / ice

track changes with javascript
Other
1.71k stars 194 forks source link

cts-number choosing doesn't work in real time collaborative mode #90

Closed johanneswilm closed 10 years ago

johanneswilm commented 10 years ago

This is a bit complex:

The cts-X class that is chosen should start from cts-1 and then go up. The choosing of what number is taken seems to be happening when entering the editor. So if it detects that some changes have been made using cts-1 and with a different user id than the current one, it chooses cts-2, etc. .

This works great, but what if both users enter the editor simultaneously through a n online collaborative editor? Both are given cts-1 .

I am trying to figure out what to do about this. I think what needs to happen is that the checking for which cts-X number to use has to happen at the point when the first change node is about to be created.

I think I will try to do some modifications along those lines in the coming days, unless someone has a better idea.