<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>247793</bug_id>
          
          <creation_ts>2022-11-11 02:11:32 -0800</creation_ts>
          <short_desc>Clicking a link to a download file served by a service-worker with a fetch event handler yields &quot;Frame load interrupted&quot; error</short_desc>
          <delta_ts>2022-11-16 03:01:50 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Service Workers</component>
          <version>Safari 16</version>
          <rep_platform>All</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=247885</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Steffen Weber">steffen.weber</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>achristensen</cc>
    
    <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1911774</commentid>
    <comment_count>0</comment_count>
      <attachid>463490</attachid>
    <who name="Steffen Weber">steffen.weber</who>
    <bug_when>2022-11-11 02:11:32 -0800</bug_when>
    <thetext>Created attachment 463490
reduced test-case

When clicking a link to a file that Safari has to download (because of its MIME-type, a &quot;Content-disposition&quot; header, or a &quot;download&quot; 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: &quot;Failed to load resource: Frame load interrupted&quot;.

This is a regression in Safari 16.0 or 16.1. We&apos;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 &quot;Powered by WebKitGTK 2.38.2&quot;).

I&apos;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&apos;t have to download but can display itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912113</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-13 14:52:30 -0800</bug_when>
    <thetext>&lt;rdar://problem/102296700&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912199</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-11-14 00:03:17 -0800</bug_when>
    <thetext>It appears the reduced test case only contains an empty file.
Can you upload a new reduced test case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912203</commentid>
    <comment_count>3</comment_count>
      <attachid>463514</attachid>
    <who name="Steffen Weber">steffen.weber</who>
    <bug_when>2022-11-14 00:15:55 -0800</bug_when>
    <thetext>Created attachment 463514
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. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912212</commentid>
    <comment_count>4</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-11-14 01:06:21 -0800</bug_when>
    <thetext>I can see the &quot;Failed to load resource: Frame load interrupted&quot;, 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912217</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-11-14 01:21:01 -0800</bug_when>
    <thetext>I&apos;ll work on fixing the &quot;Frame load interrupted&quot;.
It seems this message was there in Safari 15.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912218</commentid>
    <comment_count>6</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-11-14 01:22:55 -0800</bug_when>
    <thetext>@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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912220</commentid>
    <comment_count>7</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-11-14 01:24:46 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6463</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912246</commentid>
    <comment_count>8</comment_count>
      <attachid>463519</attachid>
    <who name="Steffen Weber">steffen.weber</who>
    <bug_when>2022-11-14 02:18:21 -0800</bug_when>
    <thetext>Created attachment 463519
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&apos;t verify the results in Safari again. (It&apos;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 &quot;FetchEvent.preloadResponse&quot; to the mix to trigger this bug. Please have a look at the updated test-case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912249</commentid>
    <comment_count>9</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-11-14 02:35:17 -0800</bug_when>
    <thetext>Thanks Steffen, I can reproduce and will fix the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912815</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-16 00:52:06 -0800</bug_when>
    <thetext>Committed 256725@main (30bd7667b181): &lt;https://commits.webkit.org/256725@main&gt;

Reviewed commits have been landed. Closing PR #6463 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912829</commentid>
    <comment_count>11</comment_count>
    <who name="Steffen Weber">steffen.weber</who>
    <bug_when>2022-11-16 03:00:53 -0800</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912830</commentid>
    <comment_count>12</comment_count>
    <who name="Steffen Weber">steffen.weber</who>
    <bug_when>2022-11-16 03:01:50 -0800</bug_when>
    <thetext>Oops, forgot that this bug is only about the console error.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>463490</attachid>
            <date>2022-11-11 02:11:32 -0800</date>
            <delta_ts>2022-11-14 00:15:55 -0800</delta_ts>
            <desc>reduced test-case</desc>
            <filename>safari-bug-dl.zip</filename>
            <type>application/zip</type>
            <size>208</size>
            <attacher name="Steffen Weber">steffen.weber</attacher>
            
              <data encoding="base64">UEsDBBQACAAIAKhWa1UAAAAAAAAAAAAAAAAOACAAZW1wdHktZmlsZS50eHRVVA0AB4wbbmOMG25j
jBtuY3V4CwABBOgDAAAE6AMAAAMAUEsHCAAAAAACAAAAAAAAAFBLAQIUAxQACAAIAKhWa1UAAAAA
AgAAAAAAAAAOACAAAAAAAAAAAACkgQAAAABlbXB0eS1maWxlLnR4dFVUDQAHjBtuY4wbbmOMG25j
dXgLAAEE6AMAAAToAwAAUEsFBgAAAAABAAEAXAAAAF4AAAAAAA==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>463514</attachid>
            <date>2022-11-14 00:15:55 -0800</date>
            <delta_ts>2022-11-14 02:18:21 -0800</delta_ts>
            <desc>reduced test-case (for real)</desc>
            <filename>safari-bug.zip</filename>
            <type>application/zip</type>
            <size>902</size>
            <attacher name="Steffen Weber">steffen.weber</attacher>
            
              <data encoding="base64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JRAAAAXwAAABAAIAAAAAAAAAAAAKSBpwEAAHNhZmFyaS1idWctc3cuanNVVA0AB/X3
cWP193Fj9fdxY3V4CwABBOgDAAAE6AMAAFBLBQYAAAAAAwADABoBAABWAgAAAAA=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>463519</attachid>
            <date>2022-11-14 02:18:21 -0800</date>
            <delta_ts>2022-11-14 02:18:21 -0800</delta_ts>
            <desc>reduced test-case v3</desc>
            <filename>safari-bug.zip</filename>
            <type>application/zip</type>
            <size>1031</size>
            <attacher name="Steffen Weber">steffen.weber</attacher>
            
              <data encoding="base64">UEsDBBQACAAIAMVTblUAAAAAAAAAAKsAAAAPACAAc2FmYXJpLWJ1Zy5odG1sVVQNAAejCnJjCvhx
Y6MKcmN1eAsAAQToAwAABOgDAAA9jkEOgjAQRddyisoGXbQ9gJWVd3A90KGM1JZMKwRPbxOIq/+T
l7w8c7axz9uMYsxv31bmmC7ara1OJvVMcy4vwEIOcmSVkBfq8Rl5QlaMjlJGvjT6AHLdySs111tR
6L/DgBgZh3udYAAm2X2ctF59aa7bR1yDj2CFpzAZDaVB7xFG700/UEsHCFGQbciFAAAAqwAAAFBL
AwQUAAgACAAGSW5VAAAAAAAAAADQAAAAEQAgAHNhZmFyaS1idWctZGwuemlwVVQNAAdt93Fjbfdx
Y2EFcmN1eAsAAQToAwAABOgDAAAL8GZmEWHgAMIVYdmhDEiAj0GBITW3oKRSNy0zJ1WvpKIkNISX
gb1HOi8ZhksruBkYWV4wMzCACWaGAG92DpBeJqgZAd6MTCLMqOYzIZkPA0saQSRptgV4s7KBdDEC
YQyQjgObBABQSwcIU2PEfmYAAADQAAAAUEsDBBQACAAIAJNZblUAAAAAAAAAAKABAAAQACAAc2Fm
YXJpLWJ1Zy1zdy5qc1VUDQAHlhRyY/X3cWOWFHJjdXgLAAEE6AMAAAToAwAAjZA9bsMwDIVn6RTa
QgGBLxCkW7cORYEiM2PTDlGBdkX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