You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serve: missed watcher events on macOS leave an open model stale #918
On macOS, simlin-serve can miss an external edit to a model file, and a model that is already open then keeps serving the old content with no error or log line.
A later browser save merges against that stale copy and can overwrite the external edit.
The server should notice a file changed on disk even when no watcher event arrives.
Example
Measured on a macOS host with fseventsd and Spotlight under heavy load:
watch() took 3.5 s to return, and the first event arrived about 1.5 s after that.
A write made 2 s after watch() returned was never reported in most runs (from 3 of 4 up to 6 of 6).
A stream idle for about 2 s dropped the next event; this reproduced with raw notify, without the debouncer.
FSEvents finishes registering a stream asynchronously after watch() returns, and changes made before registration completes are never delivered.
Why it matters
Seen only on a developer machine while chasing flaky watcher tests (#916), not in a user report.
The startup window is less important than it looks: models are read from disk lazily on first open, so a missed edit to a model nobody has opened yet is harmless.
The dropped-event-when-idle case can happen at any time to an open model.
Linux (inotify) has not shown this.
Fix
Do not trust the watcher to be lossless.
Before serving or saving an open model, stat the file and compare mtime and size (or the content hash) with what the registry last recorded; if they differ, run the same merge the watcher would have run.
Alternative: a periodic rescan of the tree, which costs a stat walk proportional to tree size.
changed the title [-]serve: external edits made during watcher startup are silently and permanently lost[/-][+]serve: missed watcher events on macOS leave an open model stale[/+]on Oct 12, 2026
Activity
[-]serve: external edits made during watcher startup are silently and permanently lost[/-][+]serve: missed watcher events on macOS leave an open model stale[/+]