fs: preserve filename when recursive watch root file is removed - #65882
fs: preserve filename when recursive watch root file is removed#65882cuishuang wants to merge 1 commit into
Conversation
Signed-off-by: cuishuang <imcusg@gmail.com>
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. Caution AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65882 +/- ##
==========================================
- Coverage 90.19% 90.18% -0.01%
==========================================
Files 771 771
Lines 264911 265094 +183
Branches 50323 50351 +28
==========================================
+ Hits 238939 239082 +143
- Misses 16922 16963 +41
+ Partials 9050 9049 -1
🚀 New features to boost your workflow:
|
When the JavaScript recursive watcher is used, removing a watched root file emits an empty filename.
This happens because the deletion path uses the root-relative filename, and the relative path of the root file to itself is empty. The same watcher emits the basename for change events, while native recursive watchers also report the basename.
Emit the basename in the root-file deletion branch to keep the result consistent with change events and native recursive watchers.
Tests:
Refs: #65486