Implement comprehensive fixes for sync system issues

- Introduced a new plan to address eight identified issues in the sync system, including improvements to standalone script handling, property persistence, and file watcher behavior.
- Key changes include extracting standalone-to-directory conversion logic, enhancing property update persistence, and implementing a recovery mechanism for rapid delete+recreate scenarios.
- Added integration tests to ensure coverage for each fix and improve overall system reliability.
- Enhanced logging for VFS events to aid in debugging file watcher desynchronization issues.

This commit significantly improves the robustness of the sync system and addresses critical issues identified in the audit.
This commit is contained in:
Joe 2026-02-05 18:25:47 -06:00
parent 4a03d4bab5
commit 0968e74208
5 changed files with 1651 additions and 319 deletions

View file

@ -236,10 +236,13 @@ impl VfsInner {
}
fn commit_event(&mut self, event: &VfsEvent) -> io::Result<()> {
if let VfsEvent::Remove(path) = event {
let _ = self.backend.unwatch(path);
}
// NOTE: We intentionally do NOT unwatch on Remove events.
// The path may be recreated immediately (e.g., editor undo), and
// unwatching causes future events for the recreated path to be missed.
// Stale watches are harmless — notify silently ignores events for
// non-existent paths, and the watch will be cleaned up when the
// parent is unwatched.
let _ = event;
Ok(())
}
}