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
I was wondering what case this line of code should cover. Is that related to fractional position conflicts between multiple editors?
How Conclave behaves when an insert message comes after locally inserting a symbol with the same fractional position of the character coming from the message. I mean, shouldn't all the editors follow the same fractional position ordering? If the algorithm just searches for the position before and after the character, will the state between editors be broken?
The text was updated successfully, but these errors were encountered:
You're correct that when two different symbols with the same fractional position are inserted at (or near) the same time, all the editors should follow the same logical ordering. And that's what that line is attempting to do (at least from my best recollection, it's been a while since I've touched Conclave code).
All users who're collaborating on a document are given an ID, which is the siteId you see in that line of code. The reason we're checking the siteId in that line of code is because of this line. That line is saying that both symbols have the same fractional position. If both symbols have the same fractional index, then we insert whichever symbol came from the user with the smaller siteId since someone has to be positioned first and we just decided to use the user with the smaller id.
I'm not sure what you mean about mean, shouldn't all the editors follow the same fractional position ordering?. This code is running on all of the browsers of the users who're collaborating, so they're all using the same fractional position ordering logic.
I'm also not super clear on your question If the algorithm just searches for the position before and after the character, will the state between editors be broken?. The algorithm that you pointed to (generatePosBetween), is run only once for a symbol. Whenever a user inserts a symbol or character into the document, that symbol needs to be given a fractional index. And that index is determined by the indexes of the characters surrounding it.
However, once it's given a fractional index, that index stays fixed and isn't recalculated. So when that symbol is emitted to the other users so that their documents can sync-up, they take the index that was calculated and insert it into the document based on it's position here
I hope that helps clarify your question. The code definitely is pretty messy. We wrote Conclave rather quickly and didn't spend too much time cleaning up or making things look nicer.
I was wondering what case this line of code should cover. Is that related to fractional position conflicts between multiple editors?
How Conclave behaves when an insert message comes after locally inserting a symbol with the same fractional position of the character coming from the message. I mean, shouldn't all the editors follow the same fractional position ordering? If the algorithm just searches for the position before and after the character, will the state between editors be broken?
The text was updated successfully, but these errors were encountered: