<?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>119974</bug_id>
          
          <creation_ts>2013-08-18 00:40:28 -0700</creation_ts>
          <short_desc>[eventsource] If there is a network error, the readyState of eventsource got CONNECTING but not CLOSED.</short_desc>
          <delta_ts>2014-04-14 12:35:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></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>0</everconfirmed>
          <reporter name="tinazhao">tina.zhao</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>afbarstow</cc>
    
    <cc>ap</cc>
    
    <cc>zhiqiang.zhang</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>918394</commentid>
    <comment_count>0</comment_count>
    <who name="tinazhao">tina.zhao</who>
    <bug_when>2013-08-18 00:40:28 -0700</bug_when>
    <thetext>[ServerSentEvent]
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36

Steps to reproduce:
According to the spec description, if there is a network error, the readyState is expected as 2 (CLOSED).

Spec Info: Server-Sent Events Candidate Recommendation 11 December 2012  (http://www.w3.org/TR/2012/CR-eventsource-20121211/ ).
Spec Description:
&quot;CLOSED (numeric value 2)
The connection is not open, and the user agent is not trying to reconnect. Either there was a fatal error or the close() method was invoked.&quot;

- Test wiki: http://www.w3.org/wiki/Webapps/Interop/ServerSentEvents
- Test suite: https://github.com/w3c/web-platform-tests/tree/master/eventsource
- Test case: http://w3c-test.org/web-platform-tests/master/eventsource/shared-worker/eventsource-constructor-non-same-origin.htm

Actual results:
Assersion failed: assert_equals: source.readyState expected 2-CLOSED but got 0-CONNECTING.
This test Failed on Chrome 28.0.1500.95 m, got PASS on Opera Next 12.16

Expected results:
In this case, readyState is expected 2-CLOSED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999272</commentid>
    <comment_count>1</comment_count>
    <who name="Arthur Barstow">afbarstow</who>
    <bug_when>2014-04-09 13:27:52 -0700</bug_when>
    <thetext>The URL of the test case in the original comment is now wrong. The test case is now https://github.com/w3c/web-platform-tests/blob/master/eventsource/eventsource-constructor-non-same-origin.htm

The test case can be run via a browser (at least today) via:

  http://w3c-test.org/eventsource/eventsource-constructor-non-same-origin.htm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999579</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-04-10 10:54:52 -0700</bug_when>
    <thetext>Could you please elaborate why this is a WebKit bug? Both failing tests try connecting to https://example.not/test, and expect CLOSED state.

But the current editor&apos;s draft even gives it as an example that &quot;Network errors that prevents the connection from being established in the first place (e.g. DNS errors), must cause the user agent to asynchronously reestablish the connection.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1000558</commentid>
    <comment_count>3</comment_count>
    <who name="Arthur Barstow">afbarstow</who>
    <bug_when>2014-04-14 11:44:37 -0700</bug_when>
    <thetext>Alexey - I screwed up the URL in comment #1 - the updated URL I provided actually passes.

Although Tina or Zhiqiang should be able to confirm, there are two tests that fail and here are there new URLS:

1. http://w3c-test.org/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm

2. http://w3c-test.org/eventsource/shared-worker/eventsource-constructor-non-same-origin.htm

FYI, there was a discussion thread about these two test files in August 2013: http://lists.w3.org/Archives/Public/public-webapps-testsuite/2013Aug/0009.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1000574</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-04-14 12:35:35 -0700</bug_when>
    <thetext>Thanks. Perhaps we need a separate bug about that, as CORS error is not a network error (I think?)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>