Skip to content

fix: sync nested moveAcross destination parent - #59

Merged
HaoZeke merged 3 commits into
developfrom
fix/moveacross-nested-target-parent
Nov 22, 2026
Merged

HaoZeke merged 3 commits into
developfrom
fix/moveacross-nested-target-parent

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

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.

@HaoZeke
HaoZeke changed the base branch from fix/copyto-nested-target-parent to main November 20, 2026 04:24
@HaoZeke
HaoZeke changed the base branch from main to develop November 21, 2026 05:33
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
HaoZeke force-pushed the fix/moveacross-nested-target-parent branch from c784fe9 to 9732e4f Compare November 22, 2026 02:14
@HaoZeke
HaoZeke merged commit 33ac564 into develop Nov 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant