-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deno.watchFs
does not catch 'remove' event since v2.0.3
#26906
Comments
@kt3k Is this on macOS or Linux? |
I checked that on macos |
I checked it on windows. it did not work in Windows as well. |
it is the move and remove event is not triggered. and when we use move command to rename it works as expected. |
Fix related to #26906. Currently, if a file is removed, no event is emitted because the file path no longer exists. As a result, [this check](https://github.com/denoland/deno/blob/12b377247be2b74155ded3a678ff2996ef3d7c9f/runtime/ops/fs_events.rs#L149) returns false. With this PR, an additional check is introduced to verify if the file exists. If the file does not exist, a custom "remove" event is emitted. This change is necessary because, based on tests conducted on macOS and Linux (Ubuntu 24.04.1 LTS), Linux emits a "rename" event instead of a "remove" event when a file is deleted. Introducing a dedicated "remove" event ensures consistent and clearer behavior across platforms.
Fix related to #26906. Currently, if a file is removed, no event is emitted because the file path no longer exists. As a result, [this check](https://github.com/denoland/deno/blob/12b377247be2b74155ded3a678ff2996ef3d7c9f/runtime/ops/fs_events.rs#L149) returns false. With this PR, an additional check is introduced to verify if the file exists. If the file does not exist, a custom "remove" event is emitted. This change is necessary because, based on tests conducted on macOS and Linux (Ubuntu 24.04.1 LTS), Linux emits a "rename" event instead of a "remove" event when a file is deleted. Introducing a dedicated "remove" event ensures consistent and clearer behavior across platforms.
will this works now if i update my deno version? |
I checked with the latest Deno and it seems working now (Looks like fixed by #27041) |
The below script catches 'remove' events until Deno 2.0.2:
However, it doesn't catch "remove" event anymore since Deno 2.0.3.
Version: Deno 2.0.3
The text was updated successfully, but these errors were encountered: