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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25969</bug_id>
          
          <creation_ts>2014-06-04 04:27:25 +0000</creation_ts>
          <short_desc>[XHR] Does &quot;process response body&quot; get processed even if the XHR is abort()-ed in readystatechange?</short_desc>
          <delta_ts>2014-06-25 06:55:39 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>XHR</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Takeshi Yoshino">tyoshino</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>107232</commentid>
    <comment_count>0</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2014-06-04 04:27:25 +0000</bug_when>
    <thetext>&quot;process response&quot; and &quot;process response body&quot; are separately queued (specified in fetch.spec.whatwg.org). Even if abort() is called in readystatechange handler in &quot;process response&quot;, it seems we&apos;ll run queued task to run &quot;process response body&quot; and run redundant &quot;Handle errors for response&quot; step and unexpectedly (I believe) run steps 3 and 4. Don&apos;t we want to insert state check to &quot;process response body&quot; algorithm to skip them, or cancel tasks queued in the networking task source on termination of fetch?

Or, that &quot;handle the tasks queued&quot; is placed in the step &quot;13. Fetch req ...&quot; implies that termination of fetch also cancels task handling?

Anyway, it&apos;s nice to add some text for clarification.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107254</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-04 10:04:30 +0000</bug_when>
    <thetext>That&apos;s a good point.

I think each of process response, process response body, and process end-of-file need a check at the beginning to terminate their substeps if the send() flag is unset (due to invoking abort() or open()).

And then for synchronous fetches we also set the send() flag as it should not affect them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108109</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-20 11:22:56 +0000</bug_when>
    <thetext>I think this was fixed as part of this commit:

https://github.com/whatwg/xhr/commit/dc42bbd5884f7e9214277079853b387d573aca84

We now explicitly check if response is a network error before we continue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108110</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-20 11:23:26 +0000</bug_when>
    <thetext>Does that make sense?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108271</commentid>
    <comment_count>4</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2014-06-24 13:09:56 +0000</bug_when>
    <thetext>(In reply to Anne from comment #3)
&gt; Does that make sense?

Thanks. Confirmed that now the response update step and progress event firing step are skipped. But it looks &quot;handle errors&quot; is still invoked and calling &quot;request error steps&quot; redundantly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108275</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-24 14:18:32 +0000</bug_when>
    <thetext>https://github.com/whatwg/xhr/commit/2ee64552116bed8e201ed9bbf3f4705562920b2d

Thanks, this is hard :-( I think it is now okay.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108308</commentid>
    <comment_count>6</comment_count>
    <who name="Takeshi Yoshino">tyoshino</who>
    <bug_when>2014-06-25 06:55:39 +0000</bug_when>
    <thetext>(In reply to Anne from comment #5)
&gt; https://github.com/whatwg/xhr/commit/2ee64552116bed8e201ed9bbf3f4705562920b2d
&gt; 
&gt; Thanks, this is hard :-( I think it is now okay.

Looks good. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>