<?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>13295</bug_id>
          
          <creation_ts>2011-07-19 05:20:40 +0000</creation_ts>
          <short_desc>The &quot;make disappear a WebSocket object&quot; case should not fail the WebSocket connection</short_desc>
          <delta_ts>2011-08-08 21:24:49 +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>WebSocket API (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Raymor [MSFT]">brian.raymor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <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>51255</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Raymor [MSFT]">brian.raymor</who>
    <bug_when>2011-07-19 05:20:40 +0000</bug_when>
    <thetext>Are there valid use cases where the developer would want to capture this case as an error condition?



If a user agent is to make disappear a WebSocket object (this happens when a Document object goes away), the user agent must follow the first appropriate set of steps from the following list:
&amp;#8618;If the WebSocket connection is not yet established [WSP]
Fail the WebSocket connection. [WSP]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54263</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-05 23:05:42 +0000</bug_when>
    <thetext>I don&apos;t understand the question. What would you do instead? Let the handshake complete then close it?

How would it be captured as an error condition? It&apos;s not like any events are going to be fired, the event queue is about to be torn down...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54276</commentid>
    <comment_count>2</comment_count>
    <who name="Brian Raymor [MSFT]">brian.raymor</who>
    <bug_when>2011-08-06 00:13:38 +0000</bug_when>
    <thetext>If the connection is not established, then the preference is to treat this as a &quot;user cancel&quot; rather than an error and simply &quot;close the websocket connection&quot; and fire onClose.

The other option is to be specific about the &quot;fail the websocket connection&quot; behavior for this case and indicate onError is not fired.

Based on the definition of &quot;fail the websocket connection&quot; in the protocol draft, &quot;report the problem to the user&quot; is a MAY:

http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10#section-7.1.7

 Certain algorithms and specifications require an endpoint to _Fail
   the WebSocket Connection_.  To do so, the client MUST _Close the
   WebSocket Connection_, and MAY report the problem to the user (which
   would be especially useful for developers) in an appropriate manner.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54404</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-08 21:24:49 +0000</bug_when>
    <thetext>By the time you are to &quot;make disappear a WebSocket object&quot;, no events are going to fire ever again for that WebSocket object — the entire event queue for the Document is about to be cleared.

So the only difference here is at the protocol level, and even there, there is essentially no difference — in fact the only difference is that &quot;fail&quot; says that the UA &quot;may&quot; report a problem, as you quote. But then the UA is always allowed to do that. That&apos;s just UI.

So anyway, I don&apos;t understand what difference this would ever make. I&apos;ve left the spec as is. The requirements on user agents are identical.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>