Server-sent event retries are broken in Firefox
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox120 | --- | fixed |
People
(Reporter: evanw, Assigned: acreskey)
References
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0
Steps to reproduce:
If a page uses EventSource and the server is ever restarted, Firefox stops trying to reconnect. I assume this means that Firefox's implementation is broken since this defeats the whole purpose of having retry in the first place. See the attached screen recording for an example of Firefox's broken behavior next to Chrome and Safari, which both handle this correctly.
This can be reproduced using the following node server code:
require('http').createServer((req, res) => {
if (req.url === '/') {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.write(`
<!DOCTYPE html>
<script>
let counter = 0
const stream = new EventSource('/events')
stream.onopen = () => console.log('open', ++counter)
</script>
`)
} else if (req.url === '/events') {
res.writeHead(200, { 'Content-Type': 'text/event-stream' })
res.write('retry: 500\n')
}
res.end()
}).listen(8000)
Steps to reproduce (see also the attached screen recording):
- Run that server from the terminal
- Load the page in Firefox and use the console to observe retries happening
- Use Ctrl+C to stop the server, then restart the server
Actual results:
Firefox stops trying to reconnect once the server is restarted.
Expected results:
Firefox should continue trying to reconnect even though the server was restarted.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Events' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 3•2 years ago
|
||
That sounds like it's for this issue and it was closed four days ago. However, it doesn't appear to have been fixed. I'm testing on Nightly 2023-01-09 (i.e. from today) and Firefox still fails to retry. So it still seems to be broken?
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•2 years ago
|
||
I can still reproduce this issue in latest Nightly. Moving this to priority next.
Updated•2 years ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
bugherder |
Description
•