Skip to content
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

fix(runtime/ops): Fix watchfs remove event #27041

Merged
merged 6 commits into from
Nov 25, 2024

Conversation

DanieleAurilio
Copy link
Contributor

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 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.

@CLAassistant
Copy link

CLAassistant commented Nov 24, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@littledivy littledivy merged commit 38b618c into denoland:main Nov 25, 2024
17 checks passed
bartlomieju pushed a commit that referenced this pull request Nov 28, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants