fix: Chain moveFrom through incompatible moves - #2444
Merged
Conversation
The platform incompatibilities integration tests stubbed `blockSyncFor` to assert which changes got blocked, but the per-batch error collection (#2442) means blocking causes now flow through `scheduleRetry`, called once at the end of the batch with the array of accumulated causes. Stubbing `blockSyncFor` no longer reflects what the sync actually does. We now stub `scheduleRetry` and have `shouldHaveBlockedFor` assert it was called with a causes array containing a cause matching the expected path and `IncompatibleDoc` code. sinon's `calledWithMatch` uses `deepEqual` (full equality) for array expectations rather than partial matching, so we use `sinon.match.some(sinon.match({...}))` to assert the array contains at least one element partially matching the expected cause. Failures are asserted via `should(bool).be.true(msg)` with a self-contained message listing the actual blocked paths, since sinon's default formatter dumps the matcher internals (`{ test, message }`) and is unreadable.
taratatach
force-pushed
the
fix/chained-moves-via-incompatible
branch
from
July 3, 2026 16:40
b340f49 to
46e15e8
Compare
taratatach
force-pushed
the
fix/chained-moves-via-incompatible
branch
from
July 3, 2026 18:23
46e15e8 to
28fe349
Compare
When a remote move renamed `i` to an incompatible path `i*`, then again to a compatible path `z`, `move` set `dst.moveFrom = src` (`i*`), pointing at a path never materialized on the filesystem. The local watcher then tried to move a non-existent `i*` to `z` and failed. `move` now chains through `src.moveFrom` when the local side is not up-to-date, so `dst.moveFrom` records the actual local path to move from (the original `i`) instead of the intermediate incompatible path. When the local side is already up-to-date or `src` has no `moveFrom`, it uses `src` directly as before. Child moves are excluded from chaining: their `moveFrom` points at the path before the parent move, which the parent's sync will relocate, so chaining would point at a path that will have already moved away. The `doChildMove` guard is simplified to rely on the presence of `parent.moveFrom` rather than a path match: with chaining, the parent's `moveFrom.path` can point to the original source instead of the intermediate path, making the comparison unreliable.
taratatach
force-pushed
the
fix/chained-moves-via-incompatible
branch
from
July 3, 2026 19:56
28fe349 to
54bfca3
Compare
taratatach
marked this pull request as ready for review
July 3, 2026 20:35
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.
When a remote move renamed
ito an incompatible pathi*, thenagain to a compatible path
z,movesetdst.moveFrom = src(i*),pointing at a path never materialized on the filesystem. The local
watcher then tried to move a non-existent
i*tozand failed.movenow chains throughsrc.moveFromwhen the local side is notup-to-date, so
dst.moveFromrecords the actual local path to movefrom (the original
i) instead of the intermediate incompatiblepath. When the local side is already up-to-date or
srchas nomoveFrom, it usessrcdirectly as before.The platform incompatibilities integration tests are adapted to the
per-batch error collection (#2442):
blockSyncForis no longer theright stub since blocking causes now flow through
scheduleRetry,called once per batch with the accumulated causes array. The new
shouldHaveBlockedForusessinon.match.someto assert the arraycontains a matching cause, and reports actual blocked paths on
failure. New integration cases cover the
compatible → incompatible → compatible rename sequence.
Fixes #2446
Please make sure the following boxes are checked: