devbox/internal/syncer
shoemoney f1a6ac226f fix(syncer): stop pull from clobbering an edit made during the pull window
manifest.Build snapshots `ours` once before Pull applies any writes. A local
edit landing after that snapshot but before writeEntry looked unchanged
(oursCh false) and got overwritten with the hub version verbatim, with no
conflict copy — the edit's bytes ended up in no file and no snapshot.

Re-stat/re-hash the on-disk file right before a hub-only write would apply
and compare it against the entry manifest.Build captured. A mismatch routes
through the existing preserve-as-conflict path instead of clobbering. Only
checked when hub is about to write over a path `ours` already knew about —
a pure hub-only add has nothing on disk yet to race with.

This narrows the window, it doesn't close it: a rename at pull.go:424-451
still isn't atomic with this check. A real fix needs a filesystem-level
lock or lease around the whole pull, tracked separately.

Includes the untracked repro (zz_repro_stale_ours_test.go) that found this.
2026-08-05 02:35:12 -05:00
..
deploy_test.go chore: prep for public release — MIT license + github.com module path 🌍⚖️ 2026-06-23 19:19:09 -05:00
fsync_test.go harden(durability): fsync atomic writes before publishing the rename 💽 2026-06-23 02:59:26 -05:00
hooks_integration_test.go round9-client: log swallowed hook failures, doctor free-disk check, validate devbox ignore pattern 🩺⚠️🙈 2026-06-30 18:07:53 -05:00
preserve_ignored_test.go chore: prep for public release — MIT license + github.com module path 🌍⚖️ 2026-06-23 19:19:09 -05:00
pull.go fix(syncer): stop pull from clobbering an edit made during the pull window 2026-08-05 02:35:12 -05:00
pull_test.go chore: prep for public release — MIT license + github.com module path 🌍⚖️ 2026-06-23 19:19:09 -05:00
restore_test.go chore: prep for public release — MIT license + github.com module path 🌍⚖️ 2026-06-23 19:19:09 -05:00
safejoin_test.go fix(sec): contain manifest paths + verify blob integrity on download 🛡️🧊 2026-06-23 02:24:32 -05:00
syncer.go feat(transfer): harden the WAN sync path — timeouts, retry, parallel I/O, download gzip 🌐⚡ 2026-06-30 13:15:17 -05:00
syncer_test.go feat(device): --json output, streaming chunker, pause --for, per-mount exclude, rescan knob ✨ 2026-06-30 12:29:02 -05:00
zz_repro_stale_ours_test.go fix(syncer): stop pull from clobbering an edit made during the pull window 2026-08-05 02:35:12 -05:00