| Summary: | Clicking a link to a download file served by a service-worker with a fetch event handler yields "Frame load interrupted" error | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Steffen Weber <steffen.weber> | ||||||||
| Component: | Service Workers | Assignee: | youenn fablet <youennf> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | achristensen, cdumez, webkit-bug-importer, youennf | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | Safari 16 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Unspecified | ||||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=247885 | ||||||||||
| Attachments: |
|
||||||||||
It appears the reduced test case only contains an empty file. Can you upload a new reduced test case? Created attachment 463514 [details]
reduced test-case (for real)
Accidentally uploaded the wrong file and had already deleted the files locally. But fortunately the test-case was easy enough to recreate it. :)
I can see the "Failed to load resource: Frame load interrupted", which is probably unexpected. But I do not see the download hang (in WebKit ToT and STP 157). The file seems properly downloaded and unzipped. I'll work on fixing the "Frame load interrupted". It seems this message was there in Safari 15.5 @Steffen, let me know whether your main issue is the download hang. Since I cannot reproduce, I might ask a sysdiagnose. For now, I will use this bug entry for the console log message. Pull request: https://github.com/WebKit/WebKit/pull/6463 Created attachment 463519 [details]
reduced test-case v3
It seems like the two issues (the hanging download and the console error) are indeed unrelated. I had wrongly assumed they were related and focused on creating a reduced test-case that triggered the console error in Epiphany and later didn't verify the results in Safari again. (It's way easier for me to test in Epiphany.)
Anyway, I have created another test-case (v3) that triggers the real bug (the hanging download) in Safari. It turns out you have to add "FetchEvent.preloadResponse" to the mix to trigger this bug. Please have a look at the updated test-case.
Thanks Steffen, I can reproduce and will fix the issue. Committed 256725@main (30bd7667b181): <https://commits.webkit.org/256725@main> Reviewed commits have been landed. Closing PR #6463 and removing active labels. Thank you! May I ask in which Safari release this fix will appear? Any chance to get the fix earlier than Safari 17 in March / April 2023? Oops, forgot that this bug is only about the console error. |
Created attachment 463490 [details] reduced test-case When clicking a link to a file that Safari has to download (because of its MIME-type, a "Content-disposition" header, or a "download" attribute on the link) and which is served by a service worker with a non-empty fetch event handler, the download hangs and the developer console shows an error: "Failed to load resource: Frame load interrupted". This is a regression in Safari 16.0 or 16.1. We've been able to reproduce it on macOS 13 (Safari 16.1 18614.2.9.1.12 and Safari Technology Preview as of yesterday), on iPadOS 16.1 and on Linux (Epiphany 42.4 "Powered by WebKitGTK 2.38.2"). I've attached a reduced test-case. Remember that you have to open it on a secure origin (localhost or HTTPS) because it uses a service worker. The bug disappears when you remove the fetch event handler (or the service worker as a whole). The bug also disappears when you link to a file that Safari doesn't have to download but can display itself.