Fix batched file move watcher events#10217
Fix batched file move watcher events#10217gabrimatic wants to merge 1 commit intowarpdotdev:masterfrom
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This change factors the watcher event merge logic so it can be unit-tested against raw notify events, then queues RenameMode::From paths and consumes them FIFO when matching RenameMode::To events arrive. The added test covers the Linux-style batched from/from/to/to ordering described in the PR.
Concerns
- No blocking correctness or security concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Description
Fixes stale file tree entries after batched file move events. Linux can report multiple rename sources before their matching targets, and the watcher previously kept only one pending source path.
This queues pending rename sources and pairs them with rename targets in order, so multi-file
mv file1 file2 subdir/batches remove each old path and add each new path correctly.Linked Issue
Fixes #9592
Testing
cargo fmt --package watcher -- --checkcargo test -p watcher pairs_batched_rename_from_and_to_events_in_ordercargo test -p watchercargo clippy -p watcher --all-targets -- -D warnings