-
Notifications
You must be signed in to change notification settings - Fork 85
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
AbortError on opening files on legacy browsers #53
Comments
I just downloaded Firefox 78.11.0esr (64-bit) on macOS 12.0 Beta (21A5248p) and ran through the demo. All features worked, but for |
Yeah, I cannot reproduce either but that doesn't help us. Before I'd open a Firefox issue I'll want to take some time to review the hack we're using to polyfill the rejection, and whether it's reasonable to expect browsers to behave deterministically in this case. |
I have created a reduced test case that you can try and step through in Firefox. For all the Firefox instances I could test this with, it worked correctly (the screenshots below are from |
I'm the reporter of the linked excalidraw issue excalidraw/excalidraw#3740 and I am able to reproduce the AbortError problem using your reduced test case in 78.11.0esr. The problem Is, that selecting a file using double click leads to a pointer event being triggered before the change event of the file dialog, therefore aborting the selection. I was able to watch this by enabling event logging in the debugger for "Control -> change" and "Pointer -> Move". There were no other events interfering:
The selection does work if I submit my selection using the "open" button rather than doing a double click. I was also able to reproduce this behaviour in excalidraw as well. |
I tried doubleclick file selection and it just worked fine for me. No matter if the file open dialog is over the Firefox window, just overlapping with it, or completely distant from it. It worked in all cases. What platform are you on? |
I can intermittently reproduce in Firefox when using the double-click on the file. And another interesting thing. Trying to reproduce in Brave I was getting a different bug: the AbortError was sometimes shown right after the click, before the file dialog was opened. And since the promise was rejected beforehand, the ensuing file open didn't resolve and stayed rejected. EDIT: tried on excalidraw.com in Brave and indeed I can reproduce there as well (took ~10 tries). So Chromium is affected too, except in a different manner. |
I'm on Windows 10 64bit 20H2 (Build 19042.804) with Firefox 78.11.0esr (32-Bit) and I can reproduce the issue reliably. I can not reproduce the issue using Google Chrome Version 91.0.4472.101 (Offizieller Build) (32-Bit) using the same platform. Let me know if i can help you somehow pinpointing the problem. |
I'm getting the AbortError on FF even with single click (not sure if more or less often than double click). Leads me to believe the Chromium and FF bugs may be the same, except FF doesn't render the error in time before the dialog opens. |
How does the polyfill even work ever? browser-fs-access/src/legacy/file-open.mjs Lines 52 to 62 in ad4399f
The above catches the programmatic Maybe the browser-fs-access hack depends on the file dialog blocking the thread? But how is the ensuing Actually, from @teramawi's comment #53 (comment) it seems the EDIT: ok, checking the source, we're not listening on |
I get this issue 100% of the time on Brave. Even when not moving the mouse at all and triggering the event with Brave: |
Hi, Same issue here with FF. Here is my custom legacy setup to circumvent this matter :
Basically I'm just delaying the start of listening for "abort" events. |
I have now removed the rejection handling for legacy browsers entirely since it caused more harm than good. People who need the throwing behavior can configure their own handler, as per the option introduced in #45. |
It seems the #36 isn't fully fixed as we're still getting reports on Excalidraw. Can't reproduce on my system.
One confirmed case: excalidraw/excalidraw#3740 (comment), and one probable case excalidraw/excalidraw#3513. Both Firefox.
The text was updated successfully, but these errors were encountered: