Skip to content

Handle atomic-save file replacements#8

Open
onlylisten wants to merge 1 commit into
marswaveai:mainfrom
onlylisten:fix/atomic-save-live-reload
Open

Handle atomic-save file replacements#8
onlylisten wants to merge 1 commit into
marswaveai:mainfrom
onlylisten:fix/atomic-save-live-reload

Conversation

@onlylisten
Copy link
Copy Markdown

Summary

  • handle atomic-save workflows that replace the file with rename
  • re-establish the watcher after file replacement or watcher errors
  • clear pending debounce and rewatch timers when rotating watchers

Why

ColaMD's live reload currently relies on fs.watch, but many editors and AI tools save by writing a temp file and renaming it into place on macOS. That emits rename instead of change, which leaves the old watcher attached to the replaced inode and breaks subsequent real-time updates.

Testing

  • npm run build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant