OT: unlinking a dir doesn't later emit unlinking its immediate children

when you unlink a directory, you later get unlink ops for its descendants, but there’s an issue that causes you not to get those unlink ops for the directory’s direct children. as the OT server handles a user’s unlink op, it removes the document they’re unlinking from all clients’ registered documents. then when the server ops get broadcast, no one gets the direct children unlink ops because their parent document, i.e. that original unlinked directory, is not in anyone’s registered document sets.

this seems important though. isn’t it how clients learn about what gets deleted according to the server, as clients may have since moved things in/out of that directory that got unlinked.

example:

  1. load the editor (call this window 1) with the network dev tools open
  2. create file b/c.txt and write hello
  3. open another editor window of the project (call this window 2)
  4. window 1: set network throttling to “Offline”
    image
  5. window 2: delete the b directory
  6. window 1: move b/c.txt out to the root, c.txt
  7. window 1: set network throttling to “No throttling”

result: window 1 thinks c.txt exists, window 2 variously thinks c.txt doesn’t exist or is empty. typing into c.txt in window 1 doesn’t save anything in the project and causes script errors in window 2.

p. s. am I allowed to say #coolbugs here

5 Likes