firstsun-dev_git-files-sync/tests/logic
ClaudiaFang 06953e1b12 fix(sync): stop false-positive rename detection and 422 on rename push
detectRename only checked whether a tracked old path's file was missing
from the vault, with no content verification. Any orphaned syncMetadata
entry (e.g. left behind by a local delete, which never cleared it) would
cause the next unrelated push to be misclassified as a rename from that
stale path, using create-only semantics that 422'd if the target path
already existed remotely.

- detectRename now confirms identity by checking that the remote content
  at the candidate old path still matches what's being pushed.
- handleRename looks up the existing remote file at the new path and
  sends its sha, so pushing onto an existing remote path updates instead
  of failing with "file already exists".
- Local deletes (single and batch) now clear syncMetadata for the
  deleted path so it can't become an orphaned rename source later.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 05:44:54 +00:00
..
gitignore-manager.test.ts refactor(test): eliminate duplicate code flagged by SonarCloud 2026-05-22 03:52:32 +00:00
sync-manager-batch.test.ts fix(sync): stop false-positive rename detection and 422 on rename push 2026-07-05 05:44:54 +00:00
sync-manager-binary.test.ts refactor(test): extract shared SyncManager mock setup to reduce duplication 2026-05-22 03:40:45 +00:00
sync-manager-hidden.test.ts refactor(test): extract shared SyncManager mock setup to reduce duplication 2026-05-22 03:40:45 +00:00
sync-manager-mapping.test.ts Merge remote-tracking branch 'origin/claude/git-files-sync-issue-31-54izdm' into claude/trusting-volta-qlg8bk 2026-06-28 04:50:34 +00:00
sync-manager-test-helpers.ts refactor(test): extract shared SyncManager mock setup to reduce duplication 2026-05-22 03:40:45 +00:00
sync-manager.test.ts fix(sync): stop false-positive rename detection and 422 on rename push 2026-07-05 05:44:54 +00:00