Delete to Recycle Bin (Windows 10) does not work in SMB mounted folders
I am running Windows 10 with VHA using a Samba mounted folder as its source. When trying to delete a file (to Recycle Bin), nothing happened. This occurred on VHA 2.2.3 and on a build of main I just did. Debugtron showed:
Debugger listening on ws://127.0.0.1:5378/13898df8-a367-41eb-a0c2-f4c9b19420d4
For help, see: https://nodejs.org/en/docs/inspector
DevTools listening on ws://127.0.0.1:5379/devtools/browser/29bb328a-d6ea-4c43-9a0e-ef6e37a71f0e
(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false". It will change to be "true" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397
setting inputDirs
{ '0': { path: 'P:\\', watch: false } }
---------------------------------
SETTING UP FILE SYSTEM WATCHERS
---------------------------------
0 watch = false : P:\
HANDLE ASYNC STUFF CORRECTLY !?
(node:20028) UnhandledPromiseRejectionWarning: Error: Command failed: C:\Program Files\Video Hub App 3\resources\app.asar.unpacked\node_modules\trash\lib\windows-trash.exe P:\(20.09.2016).mp4
at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:20028) UnhandledPromiseRejectionWarning: Error: Command failed: C:\Program Files\Video Hub App 3\resources\app.asar.unpacked\node_modules\trash\lib\windows-trash.exe P:\(20.09.2016).mp4
at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
(node:20028) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20028) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20028) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:20028) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Long story short I think it's due to trash and not VHA. I tried passing the filepath to windows-trash.exe being used (from https://github.com/sindresorhus/trash) and nothing happened either. But it does work on local files. Maybe it has to do with the way Samba handles a Recycle Bin.
fs.unlink works just fine though
Thank you for the report 🤝 Does this give a user-visible error, crash the app, or just die silently without messing up the app? Please let me know 🙂
There is in version 3.0.0 going to be "Dangerously delete" option that will use fs.unlink
No errors if you are not debugging. I did try "Dangerous Delete" through the interface which works BUT you have to do it twice. The first time nothing occurs. I'll try using the debugger later to see if it catches anything from the first delete attempt.
Again this is with Samba mounted filesystems.
Odd that you have to do it twice. I wonder if the problem is with updating the view -- that is the first delete action deletes the file, but the gallery doesn't update and still shows the deleted file?
Or is it that the delete literally doesn't delete the file from the file system the first time? 😅
Thank you for investigating 🤝
@slaw1229 I had the same issue. So I created a simple delete program that function the same but succeed in deleting files via SMB. I replaced the windows-trash.exe located in "C:\Program Files\Video Hub App 3\resources\app.asar.unpacked\node_modules\trash\lib" with this file - https://github.com/NinjaMinjax/RecycleTool - which does the same job but succeed deleting via SMB. After compiling, don't forget to rename the compiled executable to windows-trash.exe and copy it and all the files to the same folder and it should work.