fsevents: detect watched directory removal#4376
Conversation
|
Not completely sure this won't break some other stuff @vtjnash ? |
fe00e44 to
eed8b52
Compare
vtjnash
left a comment
There was a problem hiding this comment.
I think there maybe is (or was) a case where it watched a whole directory instead of a file, so it was doing this in addition to checking the prefix match? I can't think of any other reason that check would be there, or any reason that check should be kept there
|
The UNIX build errors can be fixed by including |
3e0ee85 to
0ea5398
Compare
|
Updated fixing also the functionality on Windows. PTAL |
|
The USBAN failure seems unrelated to this change |
huseyinacacak-janea
left a comment
There was a problem hiding this comment.
I've tested it locally on Windows and it works.
2e551e1 to
756fe04
Compare
5fafce2 to
c4e94e3
Compare
Which was broken both in `windows` and `macos`.
e2f05ce to
9ecf830
Compare
|
This PR seems to introduce a (big) memory leak in the win/fs events path In Line 1031 in 3d78d12 |
|
No, Line 390 in 3d78d12 Are you observing a leak or just browsing through the code? |
|
We are oberving a leak which starts only after this commit (nuxt/devtools#761), it might be that this fix now makes it that it goes into the code path that #1263 fixes |
|
Ah, got it! PR: #4656 The converted filename (not the OG) needs to be freed afterwards indeed. |
After Node.js v22, fs.watch(dir) and deleting a dir will trigger the rename change event. Here we just ignore it and keep the same behavior as before v22 libuv/libuv#4376
Which was broken both in
windowsandmacos.Fixes: nodejs/node#52055