This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13071 - "Once the end of the file is reached, the user agent must dispatch the event one final time, as defined below" means an implementation may parse a partial (corrupt) event as a final event if the connection is interrupted. Spec should always require an exp
Summary: "Once the end of the file is reached, the user agent must dispatch the event ...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Server-Sent Events (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-27 17:03 UTC by contributor
Modified: 2011-08-04 21:54 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2011-06-27 17:03:03 UTC
Specification: http://dev.w3.org/html5/eventsource/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
"Once the end of the file is reached, the user agent must dispatch the event
one final time, as defined below" means an implementation may parse a partial
(corrupt) event as a final event if the connection is interrupted. Spec should
always require an explicit blank line to trigger dispatch, even at the end.

Posted from: 2620:101:8003:200:21e:c2ff:febf:6705
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:7.0a1) Gecko/20110623 Firefox/7.0a1
Comment 1 Arthur Barstow 2011-07-06 11:21:22 UTC
See this comment from Dan Veditz: http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0097.html

[[
FWIW I'm going to push for the Mozilla implementation to dispatch
only when an event is clearly terminated with a blank line (I filed
the bug). If EOF is encountered w/out a blank line it should be
considered an incomplete/corrupted event.

The "fix" for the spec would be to drop the line

   Once the end of the file is reached, the user agent must
   dispatch the event one final time, as defined below.

For clarity something explicit could be added

   If the end of the file is reached while collecting
   data and before encountering a blank line the incomplete
   event must not be dispatched.

]]
Comment 2 Arthur Barstow 2011-07-06 11:22:57 UTC
See Anne van Kesteren's reply to Dan Veditz (comment #1): http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0127.html

[[
The ABNF in http://dev.w3.org/html5/eventsource/#parsing-an-event-stream  
would also need updating.
]]
Comment 3 contributor 2011-08-04 21:54:14 UTC
Checked in as WHATWG revision r6371.
Check-in comment: Change text/event-stream to drop final events not followed by a blank line, since otherwise interrupted streams would fire incomplete events.
http://html5.org/tools/web-apps-tracker?from=6370&to=6371