Skip to content

fix: Properly order dependent moves in sync - #2447

Merged
taratatach merged 1 commit into
masterfrom
fix/order-dependent-moves-in-sync
Jul 3, 2026
Merged

fix: Properly order dependent moves in sync#2447
taratatach merged 1 commit into
masterfrom
fix/order-dependent-moves-in-sync

Conversation

@taratatach

@taratatach taratatach commented Jul 3, 2026

Copy link
Copy Markdown
Member

compareChanges returned KEEP_ORDER for two chained moves where one
frees the path the other takes (e.g. i → i* followed by
j → i). The dependent move could run before its destination was
freed, failing with a "destination already exists" error.

We now detect this case in compareChanges — both ops are MOVE with
a moveFrom and one's destination equals the other's source — and
order the freeing move first.

Fixes #2445

Please make sure the following boxes are checked:

  • PR is not too big
  • it improves UX & DX in some way
  • it includes unit tests matching the implementation changes
  • it includes scenarios matching a new behaviour or has been manually tested
  • it includes relevant documentation

@taratatach taratatach self-assigned this Jul 3, 2026
Base automatically changed from feat/handle-multiple-sync-errors to master July 3, 2026 13:24
  `compareChanges` returned `KEEP_ORDER` for two chained moves where one
  frees the path the other takes (e.g. `i` → `i*` followed by
  `j` → `i`). The dependent move could run before its destination was
  freed, failing with a "destination already exists" error.

  We now detect this case in `compareChanges` — both ops are `MOVE` with
  a `moveFrom` and one's destination equals the other's source — and
  order the freeing move first.
@taratatach
taratatach force-pushed the fix/order-dependent-moves-in-sync branch from 1733470 to f0c041e Compare July 3, 2026 15:18
@taratatach
taratatach merged commit 3b91bc1 into master Jul 3, 2026
12 of 17 checks passed
@taratatach
taratatach deleted the fix/order-dependent-moves-in-sync branch July 3, 2026 15:18
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.

Chained moves (a → c, b → a) are not always applied in the right order and the second can fail with "destination already exists"

1 participant