Repository navigation
Conversation
move_entry wrote only the directory's own row, so every row under it kept its old path, and delete tombstoned a directory while its children stayed live. A directory now moves with all its live descendants in the same atomic write, a destination that holds a live entry is refused when either side is a directory, and delete refuses a directory that still has live rows under it, as the Backend trait's delete is non-recursive. Descendants are matched by exact path prefix.
This was referenced Dec 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P2pBackend::move_entrywrote only the moved entry's own row, so moving a directory left every row under it at its old path, anddeletetombstoned a directory while its children stayed live.A directory now moves with all its live descendants inside the same
write_atomicallystep, each as a new row plus a tombstone at the old path. A move onto a live entry is refused withConflictwhen either side is a directory, anddeleterefuses a directory that still has live rows under it. That is the non-recursiveBackend::deletecontract that #100 writes down and that NFSRMDIRandcascade rmrely on; callers that mean a recursive delete get one from #100'svfs::transfer::delete_tree. Descendants are matched by exact path prefix rather thanLIKE.This was part of #100, but main has since rewritten
deleteandmove_entryaroundwrite_atomically, so it is made against main here and #100 keeps only the P2Pmetadatachange. The two branches merge with no conflict.New tests
moving_a_directory_moves_its_contents,moving_a_directory_onto_an_existing_entry_is_refusedanddeleting_a_non_empty_directory_is_refusedall fail on main.cargo fmt --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass.Update 2026-12-01: parked in favour of #117
#100 is parked and its read-only mount fix is now #117, so this pull request, which completes #100's delete contract for P2P, stays a draft with it. Open problems in this change are #113 (a destination folder with no row of its own is not seen) and #114 (subfolders a peer creates under the old path, or that have no row, are left behind); the rest of the split is listed on #100.