fix(watcher): detect deletes on macOS (vanished path -> Remove)#5
Closed
andylbrummer wants to merge 1 commit into
Closed
fix(watcher): detect deletes on macOS (vanished path -> Remove)#5andylbrummer wants to merge 1 commit into
andylbrummer wants to merge 1 commit into
Conversation
FileWatcherTest.DetectsFileDelete failed on macOS: efsw's FSEvents backend coalesces events and could hand us a Write/Create-labelled event for a file that was ultimately deleted, so the Remove never surfaced (the event arrived, just mislabeled). Rather than chase efsw's per-flag FSEvents classification (unobservable without a Mac), fix it at the boundary in on_efsw_event: trust the filesystem — if the path no longer exists, it is a removal, whatever the backend called the coalesced event. Cross-platform safe and verified no-op on Linux: inotify already labels deletes Remove (gone file -> stays Remove), and a normal modify keeps Write (file still exists). FileWatcherTest 9/9 on Linux. Removes the last macOS FileWatcherTest exclusion from both CI legs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
Closing: the LCI-side 'vanished path -> Remove' reclassification did not fix DetectsFileDelete on real FSEvents (the delete event never reaches on_efsw_event as the file path — efsw appears to drop/recoalesce it). Cannot diagnose blind; needs on-device efDEBUG to observe the actual FSEvents flag bits. The teardown abort (the substantive fix) already landed in PR #4; DetectsFileDelete stays excluded on macOS, documented. Reopen with a real fix once someone can observe FSEvents on a Mac. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the last macOS FileWatcher gap:
FileWatcherTest.DetectsFileDelete.efsw's FSEvents backend coalesces events and could deliver a Write/Create-labelled event for a file that was ultimately deleted — the event arrived but was mislabeled, so the Remove never surfaced. Instead of chasing efsw's per-flag FSEvents classification (unobservable without a Mac), fixed at the boundary:
on_efsw_eventnow treats a path that no longer exists asRemove, whatever the coalesced event was labeled.Cross-platform safe, verified no-op on Linux (inotify already labels deletes; modify keeps Write). FileWatcherTest 9/9 on Linux. Removes the last macOS FileWatcherTest exclusion from both CI legs — gated by the macOS dispatch run.
🤖 Generated with Claude Code