Fix batched file move watcher events - #10217
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
b68b05e to
d5f7a57
Compare
moirahuang
left a comment
There was a problem hiding this comment.
overall this looks good to me! just a small comment and then i'll approve!
|
@gabrimatic mind attaching a video of you testing the original issue's use case please? |
|
@gabrimatic fyi I am clarifying in the original issue about how to reproduce the issue #9592 (comment) |
warp-pr-10217-file-tree-move-review.mp4 |
|
Hello @moirahuang , I'm sending a video capture. Screenrecord_1_warpbug.mp4 |
|
@sergioanselmi thank you for the video! I asked my teammate @acarl005 to test on his Ubuntu 24.04.03 ARM in Parallels VM and he's not able to reproduce the issue your video. Do you mind sending over your logs please? https://docs.warp.dev/support-and-community/troubleshooting-and-support/sending-us-feedback/#gathering-warp-logs Screen.Recording.2026-05-13.at.1.50.16.PM.mov |
|
Hi @moirahuang, attaching the logs as requested. I'm running Warp on Ubuntu 24.04 (x86_64). The issue reproduces consistently for me with basic mv + ls sequences in the file tree panel. The reproduction steps performed during the logged session (~15:57–15:59 UTC-3) were:
Two files attached: |
|
@sergioanselmi Thank you for the logs, they're really helpful! It looks like the actual reason why project explorer isn't showing your files is because Warp is failing to register filesystem watchers for the exact directories in your recording because the process has hit the max watch limit. That explains why @acarl005 wasn't able to reproduce, he likely hasn't hit his watcher limit. I'm going to 1) close this PR since it's not addressing this issue 2) going to mark the original issue as |
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