A bug occurred when several files deleting after confirmation in the dialog box. I did not wait for the process to end, I pressed "delete" again and as a result ALL files in the media folder were deleted.
Haven't replicated it for testing just yet but I imagine this would be because the reference passed for what resource should be deleted is somehow being set to the containing folder after the first request.
The files were deleted from the media / uploaded-files folder. But as a result, all files and subfolders in the media folder have been deleted.
Unable to replicate, I receive the error:
dev.ERROR: exception 'League\Flysystem\FileNotFoundException' with message 'File not found at path: media/around-glenrowan-150x150.jpg' in ~\vendor\league\flysystem\src\Filesystem.php:385
Try checking on a slow connection.
That's what I did, I opened Chrome tools and artificially throttled my connection to the speed of a 56k modem. Can anyone else replicate this?
media/test/test2/
file1.png
file2.png
file3.png
Step 1: select file2
Step 2: click Delete
Step 3: click Ok
Step 4: Deletion process started
Step 5: Not waiting for the completion of the removal process clicked Delete
Step 6: click Ok
Result - folders "test" and "test2" deleted together with files "file1, file2, file3"

You'd have to check it on a slow server, the connection only affects the speed of the communication to the server, not how long it takes the server to "boot up" the initial deletion request and then actually delete the files. Try telling PHP to sleep() for long enough to send a second request before actually deleting the files.
need disable button "Delete" when deletion process started
@LukeTowers were you able to replicate this? Seems very odd that the code would trash the entire contents.
@daftspunk Not yet, I'll bump this up on my priority list to look at
I was able to replicate this:
Folder Structure:
storage/app/media:
- rootFileTest.png
- test
- file1.png
- file2.png
- file3.png
- test2
- file1.png
- file2.png
- file3.png
Selected files:

First delete request posted FormData:
search:
sorting:title
paths[0][path]:/test/test2/file1.png
paths[0][type]:file
paths[1][path]:/test/test2/file2.png
paths[1][type]:file
paths[2][path]:/test/test2/file3.png
paths[2][type]:file
Second delete request posted FormData: (made immediately after the first request without waiting for it to finish)
search:
sorting:title
paths[0][path]:/test
paths[0][type]:folder
Result:
Folder Structure:
storage/app/media:
- rootFileTest.png
This problem is caused by two reasons:
..) item is selected I don't think that 2 is an expected result and should be what I'm focusing on to prevent.
Fixed by #2867
Most helpful comment
Fixed by #2867