How should Acme Sync detect file changes?
We need to detect when files change on disk so we can trigger sync. The approach affects battery life, CPU usage, sync latency, and cross-platform complexity.
⏱ Decision needed by 2026-05-22Click any cell to expand its rationale
| Criteria | A: FS Watchers FSEvents / inotify / ReadDirectoryChangesW | B: Polling Directory hash scan every 30s | C: Write Intercept Hook OS file write syscalls | D: Hybrid FS watchers + hash verification |
|---|
Recommendation
Hybrid: FS Watchers + Hash Reconciliation
Use
chokidar
(wraps all three native watcher APIs — FSEvents, inotify,
ReadDirectoryChangesW) for near-instant event delivery, with a
lightweight hash-based reconciliation pass every 5 minutes to catch
any missed events. This is the only option that is both low-latency
AND correct for large directories with burst writes. The
implementation complexity is manageable: chokidar's abstraction
layer handles most platform differences, and the reconciliation loop
is a straightforward directory hash comparison already prototyped.
Battery and CPU impact is acceptable — hashing runs only on detected
change events rather than on a fixed timer.