iterate-ch / cyberduck

Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
https://cyberduck.io/
GNU General Public License v3.0
3.29k stars 290 forks source link

The "Open URL" and "Copy URL" functionality hangs and crashes the application when too many (100+) files are selected #15506

Open JBMiller opened 9 months ago

JBMiller commented 9 months ago

Describe the bug The "Open URL" and "Copy Url" functionality hangs and/or crashes the application when too many files are selected prior to simply hovering over the option. I have accidently crashed the application over 3 times now just trying to bulk delete files just because I moved my mouse over the option while going down to the delete option in the right-click context menu. Even hovering over "Open Url" in the File menu bar item causes the same effect.

To Reproduce Steps to reproduce the behavior:

  1. Connect to AWS S3 or Rackspace Cloud Files.
  2. Select many files, like 30+ or 100+, by either clicking one, holding shift, and clicking another so it selects everything in between, or pressing Ctrl + A, or however you'd like to do it.
  3. Open the context menu by right clicking any of the files while they are all selected (alternatively, the File menu bar item). Move your mouse over "Copy URL" or Open URL".
  4. At this point the application will either hang or crash.

Expected behavior I would hope that the application wouldn't crash, or at least just know its limit and not try to do such an expensive process without explicit direction from the user. Suggestions:

Screenshots An example of me selecting 100+ files, right clicking and moving my mouse past "Copy URL". It hangs here for several seconds before becoming responsive again. image

Here is another example, this time with 500+ selected files and it becoming unresponsive, eventually regaining control after a minute or so. The big black rectangle is a visual glitch that happens as a result of it becoming unresponsive and me clicking it a few times: image

Desktop:

Log Files cyberduck.log

AliveDevil commented 8 months ago

Issue is, we generate a massive live of menu items - for each file one item. image Selecting a couple of files isn't an issue with this, though hundreds of files might pose a serious issue for Windows.

With 568 items selected Cyberduck will create 2840 menu items, which I'm not sure Windows is happy about.

@dkocher My suggestion: Create an ellipse-entry after the first N-items, or just use the titles, without including the files in the menu.

Some context for you, @JBMiller, here:

Asynchronously fetch each URL individually as the context item remains hovered over

That is one way, but as seen in the screenshot above every file is added multiple times to the context menu (currently). These menu items aren't usable anyway, as the copied URL is always of the format

http://setup.s3.lab.xc/Cyberduck-Installer-8.5.5.39131.exe
http://setup.s3.lab.xc/Cyberduck-Installer-8.5.10.39711.exe

So clicking "HTTPS URL" will result in a clipboard-entry of N-selected lines containing the URL of each item.

Move the operation to a modal window when you click "Copy URL" and have the operations run within that window

Ideally we want this action to be as frictionless as possible - a separate Window adds friction. Though a blocking menu is show-stopper.

Only have it get the URLs of the first few selected items.

Imho this wouldn't be a good compromise/workaround, as the link generation is faster than the creation of all those menu items. After copying the first 25 items or so, you'd have to search for the last entry, and select the next batch of items, which may be clamped to 25 items again, repeat until no items left. I'd not want to do that.

nccerhostmaster commented 8 months ago

The real problem with this issue is that it affects people who are not even trying to use the the Open URL/Copy URL menu options, but are simply moving the mouse past the option on the way to a much more useful option.

This menu option is a landmine.

The user moves the mouse down the menu on the way to their desired option. On the way to the most common options, the mouse happens to pass over an irrelevant option, and that option instantly locks up the entire client.

There's no delay, the freeze-up is instantaneous. Since options like Delete, Info, Download, and pretty much everything else anyone would ever want to do with a multi-selected list are all below the URL menu options, this problem will be encountered by every user who tries to use this menu to perform these common tasks with large lists of files.

The only way to avoid this is to somehow know in advance that this behavior will occur, then to slide the mouse sideways to go around the landmine option as you move through the menu.

Since the problem is not obviously tied to any deliberate user action, many users will simply assume Cyberduck has randomly crashed. They won't bother looking for a workaround but will just assume Cyberduck is broken.

The obvious solution is not to instantly generate the menu as soon as the mouse touches the option, but instead wait until the user actively clicks the submenu, then generate the list. An inferior but still useful solution would be to insert a short delay between when the mouse enters the area over the URL menu option and when it begins generating the submenu. Half a second or so would be enough for most people. Neither of these would make a URL list for a thousand files useful, but they'd at least eliminate the surprise landmine effect of having the entire UI lock up simply because the mouse happened to move over a specific region for a millisecond.

Another inferior option would be to move the URL menu options to the very end of the menu, where they will at least do less harm to users trying to use other menu options.