Repository navigation
fix: sync nested moveAcross destination parent - #59
Merged
Merged
Conversation
HaoZeke
changed the base branch from
fix/copyto-nested-target-parent
to
main
November 20, 2026 04:24
The moveAcross tests could watch named steps and inject a failure at one, but they could not see which directory a sync flushed. A test that moves to a nested name therefore passed whether the code synced the root descriptor or the parent that gained the entry. MoveFaults now takes a trace function. moveAcross reports each rename and each directory sync it completes through that function. A sync reports the open descriptor, so a test can stat it while the trace runs. Without a trace function the calls are the same as before. A unit test records both paths for a move between two flat names in one directory. The rename path makes one rename and one sync of that directory. The copy path makes one rename and two syncs of it, one after the publish and one after the source is removed.
moveAcross flushed the root destination descriptor after publishing, so a nested destination left the directory that receives the new entry unsynced. The temporary name already follows the destination parent through the shared helper. Both the rename path and the copy path now open the parent of the destination name and flush it, as copyTo does. The sync goes through the moveAcross trace, so a test can see which directory it reached. A unit test moves a file to a name under a subdirectory, once by rename and once through the forced copy path. Each trace must show a sync of that subdirectory after the last rename. With the root descriptor synced instead, both checks fail.
The rename path skipped the source sync when both names came from one descriptor. That was safe while the destination sync flushed the same descriptor. The destination sync now flushes the parent of a nested name. A move from dir/src to dir/sub/dst therefore flushed only dir/sub, and the removal of src from dir was never synced. The copy path synced the source descriptor after the unlink, which is the wrong directory for a nested source name such as a/src. Both paths now sync the parent of the source name. The rename path skips it only when the two names share a descriptor and the same parent path, since one sync then covers both entries. The copy path always syncs it, because the unlink comes after the publish sync. A unit test moves a flat source and a nested source to a nested destination by rename. It then moves a nested source through the forced copy path. Each trace must show syncs of the destination parent and the source parent after the last rename. A move between two names in one subdirectory must make one rename and one sync of that subdirectory.
HaoZeke
force-pushed
the
fix/moveacross-nested-target-parent
branch
from
November 22, 2026 02:14
c784fe9 to
9732e4f
Compare
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.
fix: sync nested moveAcross destination parent
moveAcross flushed the root destination descriptor after publishing,
so a nested destination left the directory that receives the new
entry unsynced. The temporary name already follows the destination
parent through the shared helper.
Both the rename path and the copy path now flush the destination
parent through the same helper copyTo uses. A regression test moves a
file through a symlink that points at another filesystem and checks
that the source is gone and the content arrives.