KB1RD / matrix-notepad

A buggy way to collaborate on text documents using the Matrix protocol. When it works, consider this the Matrix Console of collaboration!
https://matrix-notepad.kb1rd.net/
GNU General Public License v3.0
67 stars 1 forks source link

Removals cause old text to hang around #1

Closed KB1RD closed 4 years ago

KB1RD commented 4 years ago

Until I do some actual debugging, it's hard to say if this is one or multiple issues, but I have encountered removed text that I can't seem to get rid of. It happens when text from a large (multi-character) insertion is removed.

KB1RD commented 4 years ago

Thanks to the new debug panel (dev branch), I have concluded that this appears to be (partially) due to corruption of the removal BST. Since the removal BST uses the same function (Document._mergeNode), this will probably affect the Logoot and document BSTs in some scenarios. In other words, my algo is broken. Again.

KB1RD commented 4 years ago

A related issue that I was not aware of is fixed by https://github.com/KB1RD/matrix-notepad/commit/d1efc56bf193b0ab181c88b0a52e35fd60f7c4d8. This issue was caused by the node's removal offset being added to the node's known_position. This is why I need to get my act together and set up unit tests!!!

KB1RD commented 4 years ago

Fixed and on dev (now merged with master)