microsoft / Windows-classic-samples

This repo contains samples that demonstrate the API used in Windows classic desktop applications.
Other
5.06k stars 3.24k forks source link

Cloud mirror - Cloud Files API - explorer.exe locking folders and prevents rename of directory #346

Open pdupont1 opened 6 months ago

pdupont1 commented 6 months ago

We are implementing a cloud sync engine using the cloud files API. Not sure where to report this issue but I am trying here. Everything is working more or less as expected.

However if I create a folder hierarchy of 2 or more folders, say folder A has a child folder B which has another child folder C. Whenever I open folder C in the file explorer I am no longer able to rename, delete or move folder A. It states The action can't be completed because the folder or a file in it is open in another program. It does not happen when opening folder A but only when navigating into folder C.

No files are present in the folders, only the folder hierarchy and it happens every time and can be reproduced 100% on my end. This also happens on our customers system as well as our QA systems.

Screenshot 2024-05-02 083520

I checked the open handles using Powertoys File Locksmith and the Resource Monitor and only explorer.exe has open handles on the folder and subfolders.

Screenshot 2024-05-02 083452

If I restart explorer.exe the folder can be changed again. This is also an issue with OneDrive, so I can assume it has nothing to do with our own implementation of the cloud files API. Also needless to say, this only happens when interacting with folders below a sync root and not on the "regular" file system.

I am using Windows 10.0.19045. The issue also seems to happen on Windows 11 but somehow less frequent. Edit: The issue does only seem to happen on Windows 10. The alleged issue on our customers Windows 11 PC turned out to be another issue.

vembu-karthick commented 5 months ago

Issue is getting reproduced for me