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

[Fylesystem] Renaming a file on windows generates the wrong event #6315

Closed
federicobozzini opened this issue Oct 2, 2019 · 5 comments · Fixed by #7535
Closed

[Fylesystem] Renaming a file on windows generates the wrong event #6315

federicobozzini opened this issue Oct 2, 2019 · 5 comments · Fixed by #7535
Labels
bug bugs found in the application filesystem issues related to the filesystem help wanted issues meant to be picked up, require help OS/Windows issues related to the Windows OS

Comments

@federicobozzini
Copy link
Contributor

Description

When a file or a folder is renamed on Windows, I would expect Theia to generate 2 events, 1 for the file getting deleted and another one for the file getting created. This doesn't happen, due to an unexpected behaviour ofnsfw.

Reproduction Steps

On Windows, try to rename a file that is watched by NsfwFileSystemWatcherServer. When doing that 2 events are generated by nsfw, one for the renamed file with type RENAMED'containing both the old path and the new path and another one with type CREATED for the deleted file. The second event is then merged with the events generated for the file renaming according to the rule DELETED + ADDED => UPDATED and the result is the old file being described as UPDATED instead of DELETED.

I think this is a bug in nsfw, but it begs the question, do you fillit might be appropriate to address this in Theia?

OS and Theia version:

Seen on Windows 10, with the latest Theia version (master).

Diagnostics:

@akosyakov
Copy link
Member

@federicobozzini If there is a way to work it around on windows, without affecting other platforms, please do

@akosyakov akosyakov added bug bugs found in the application filesystem issues related to the filesystem help wanted issues meant to be picked up, require help OS/Windows issues related to the Windows OS labels Oct 3, 2019
@federicobozzini
Copy link
Contributor Author

I think the only reasonable way would be to ignore the unwanted event when we can assume it was generated by error.

I'm not sure if there might be a risk of false positives (events getting ignored when they shouldn't) though.

@akosyakov
Copy link
Member

@federicobozzini Could you please check whether you can reproduce it with VS Code? They use nsfw as well. If you cannot it would be good to have a look how they handle events.

I'm not sure if there might be a risk of false positives (events getting ignored when they shouldn't) though.

I'm not sure either. How would you decide which CREATED event we should ignore?

@akosyakov
Copy link
Member

We also should file an issue for nsfw with a reproducible example.

@dschafhauser
Copy link
Contributor

This issue seems to be the root cause for #6309, at least for the erroneous behavior on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application filesystem issues related to the filesystem help wanted issues meant to be picked up, require help OS/Windows issues related to the Windows OS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants