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

No file events for undo operations from finder/explorer #226903

Closed
Colengms opened this issue Aug 27, 2024 · 2 comments
Closed

No file events for undo operations from finder/explorer #226903

Colengms opened this issue Aug 27, 2024 · 2 comments
Assignees
Labels
file-watcher File watcher upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@Colengms
Copy link
Contributor

Does this issue occur when all extensions are disabled?: No (An extension is needed to create a file watcher and monitor it)

Version: 1.92.2 (user setup)
Commit: fee1edb
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

Steps to Reproduce:

  1. Write a simple extension that sets up a fileWatcher at the root of the workspace, with workspace.createFileSystemWatcher, and registers for onDidCreate (or use the C/C++ Extension with "C_Cpp.loggingLevel": "Debug" set, and monitor the C/C++ output channel for log messages that refer to fileCreate.
  2. Open the workspace and create a subdirectory within it, and a file in that subdirectory (i.e. test.h).
  3. In the File Explorer (on Windows, or Finder on macOS) delete that subdirectory. (If using the C/C++ Extension, you should see a delete for just the directory, which is fine, since delete of a directory implies its contents are deleted).
  4. Then, also in the File Explorer (on Windows, or Finder on macOS), "Undo" that deletion.

Seeing: An onDidCreate is generated for the restored directory but NOT for any of it's contents.
Expected: We should get a file creation notification for all newly discovered files, including those in a directory restored by an undo operation.

We're seeing the same issue on both Windows and macOS. The expectation is that the fileWatcher should inform us when any files or folders are created/deleted/changed under the tree we're monitoring, and not require us to recursively scan the contents of newly added directories ourselves (and only in this odd scenario).

Note that this does not happen when copying a directory full of files into the workspace. In that case, we get notifications for all contents.

MissingFileCreatedNotification.mp4
@lszomoru lszomoru assigned bpasero and unassigned lszomoru Aug 28, 2024
@bpasero bpasero added upstream Issue identified as 'upstream' component related (exists outside of VS Code) file-watcher File watcher labels Aug 28, 2024
@bpasero bpasero changed the title Missing fileWatcher notifications for contents of directory restored by undo'ing delete in File Explorer/Finder No file events for undo operations from finder/explorer Aug 28, 2024
@bpasero
Copy link
Member

bpasero commented Aug 28, 2024

Reported as upstream, its likely that the OS watcher methods (ReadDirectoryChangesW, fsevents) are not even providing this information so its hard to workaround this: parcel-bundler/watcher#185

@bpasero bpasero added the upstream-issue-linked This is an upstream issue that has been reported upstream label Sep 22, 2024
@bpasero
Copy link
Member

bpasero commented Dec 19, 2024

I am closing this issue, given the reported upstream. As we stay with parcel watcher, fixes have to go there and we are actively contributing.

@bpasero bpasero closed this as completed Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-watcher File watcher upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

3 participants