Title: fs.watch recursive on Linux emits spurious rename events for sibling files/directories prefixed by related paths on deletion · Issue #58868 · nodejs/node · GitHub
Open Graph Title: fs.watch recursive on Linux emits spurious rename events for sibling files/directories prefixed by related paths on deletion · Issue #58868 · nodejs/node
X Title: fs.watch recursive on Linux emits spurious rename events for sibling files/directories prefixed by related paths on deletion · Issue #58868 · nodejs/node
Description: Version v24.2.0 (from archlinux) and v24.1.0 (from nwjs) Platform Linux ****** 6.15.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 10 Jun 2025 21:32:33 +0000 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? open 2 window, prepare ...
Open Graph Description: Version v24.2.0 (from archlinux) and v24.1.0 (from nwjs) Platform Linux ****** 6.15.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 10 Jun 2025 21:32:33 +0000 x86_64 GNU/Linux Subsystem fs What steps will re...
X Description: Version v24.2.0 (from archlinux) and v24.1.0 (from nwjs) Platform Linux ****** 6.15.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 10 Jun 2025 21:32:33 +0000 x86_64 GNU/Linux Subsystem fs What steps will re...
Opengraph URL: https://github.com/nodejs/node/issues/58868
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fs.watch recursive on Linux emits spurious rename events for sibling files/directories prefixed by related paths on deletion","articleBody":"### Version\n\nv24.2.0 (from archlinux) and v24.1.0 (from nwjs) \n\n### Platform\n\n```text\nLinux ****** 6.15.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 10 Jun 2025 21:32:33 +0000 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nfs\n\n### What steps will reproduce the bug?\n\n1. open 2 window, prepare test files in the first window:\n```bash\nmkdir -p foo_bar/somedir\ntouch foo_bar/file.txt\nmkdir foo\ntouch foo_\n```\n2. open a node repl in the second window:\n```js\nfs.watch(\".\", { recursive: true }, console.log);\n```\n3. keep the node running, back to the first window:\n```bash\nrmdir foo\n```\nObserved output in the second window:\n```text\nrename foo\nrename foo_\nrename foo_bar\nrename foo_bar/file.txt\nrename foo_bar/somedir\n```\nand then:\n```bash\nrm foo_\n```\nObserved output in the second window:\n```text\nrename foo_\nrename foo_bar\nrename foo_bar/file.txt\nrename foo_bar/somedir\n```\n\n### How often does it reproduce? Is there a required condition?\n\nN/A\n\n### What is the expected behavior? Why is that the expected behavior?\n\nexpected not send the unrelated event(in test case, foo_bar is unchanged, but we got a fake event)\n\n### What do you see instead?\n\n(already attached output in reproduce steps)\n\n\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/Sodium-Aluminate","@type":"Person","name":"Sodium-Aluminate"},"datePublished":"2025-06-27T19:30:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/58868/node/issues/58868"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a37a8b7a-dfd5-47c5-7dc6-b8a4123b9311 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C77A:3ECFD9:14B8686:1CB7791:6A4CB277 |
| html-safe-nonce | e54726e6fe9aecc747b2e0e3a6a40c60348ebf90f4351ee2c60d9fa3da6479f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzdBOjNFQ0ZEOToxNEI4Njg2OjFDQjc3OTE6NkE0Q0IyNzciLCJ2aXNpdG9yX2lkIjoiMTI5Njg2Mjk2MzAzODk5MDk2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 92b688ef13c4645325697e9d2fa98c044d9ce7da95ba9349324f64a57b270d84 |
| hovercard-subject-tag | issue:3183892109 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/58868/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6d8d671b300cb5a8c6a5bf71166c925e376323ab67bf6e36c9b68f837274d5d6/nodejs/node/issues/58868 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6d8d671b300cb5a8c6a5bf71166c925e376323ab67bf6e36c9b68f837274d5d6/nodejs/node/issues/58868 |
| og:image:alt | Version v24.2.0 (from archlinux) and v24.1.0 (from nwjs) Platform Linux ****** 6.15.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 10 Jun 2025 21:32:33 +0000 x86_64 GNU/Linux Subsystem fs What steps will re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Sodium-Aluminate |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width