EventSource (SSE) throws JS error on page reload
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: dana, Assigned: smayya, NeedInfo)
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(4 files)
| Reporter | ||
Updated•13 years ago
|
| Reporter | ||
Updated•13 years ago
|
| Reporter | ||
Comment 2•13 years ago
|
||
| Reporter | ||
Comment 3•13 years ago
|
||
Updated•13 years ago
|
Updated•13 years ago
|
Comment 5•13 years ago
|
||
Comment 6•12 years ago
|
||
Updated•12 years ago
|
Comment 8•12 years ago
|
||
| Reporter | ||
Comment 9•12 years ago
|
||
| Comment hidden (mozreview-request) |
Updated•7 years ago
|
Updated•7 years ago
|
Comment 11•4 years ago
|
||
For those that need it a work around I'm using is to close the eventSource before the page closes.
const eventSource = new EventSource('/api/v1/firehose');
window.addEventListener('beforeunload', () => {
eventSource.close();
});
Issue is still present in Firefox 95.0.2 (64-bit)
Updated•3 years ago
|
Comment 12•2 years ago
|
||
Without the
window.addEventListener("beforeunload", handleClose);
i get the following error:
Firefox can’t establish a connection to the server at http://localhost:3001/v1/stream/events.
when i add the "beforeunload", i still get an error, but a different one:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3001/v1/stream/events. (Reason: CORS request did not succeed). Status code: (null).
Does anyone else have the same problem?
(This is not a general CORS problem. The connection is established without further problems. It is exclusively about the reload).
Comment 13•2 years ago
|
||
(In reply to Fynn from comment #12)
Without the
window.addEventListener("beforeunload", handleClose);
i get the following error:
Firefox can’t establish a connection to the server at http://localhost:3001/v1/stream/events.
when i add the "beforeunload", i still get an error, but a different one:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3001/v1/stream/events. (Reason: CORS request did not succeed). Status code: (null).
Does anyone else have the same problem?
(This is not a general CORS problem. The connection is established without further problems. It is exclusively about the reload).
Updated•12 days ago
|
Comment 14•12 days ago
|
||
Moving to Necko per the component description
| Assignee | ||
Comment 15•12 days ago
|
||
| Assignee | ||
Comment 16•12 days ago
|
||
We can suppress the error to the console when we are navigating away from the page or reloading.
This patch should resolve the bug -> https://phabricator.services.mozilla.com/D295721
This bug falls in similar pattern to the other bugs we have - when a page navigates, the APIs (fetch, XHR, SEE) reporting error.
We need to suppress error logs for cases where we navigate away/ reload. The only problem is, it safe to assume NS_BINDING_ABORTED as user-initiated error (due to navigation, reloads)? We will discuss this internally and confirm.
Updated•11 days ago
|
| Assignee | ||
Updated•11 days ago
|
Comment 17•9 days ago
|
||
Comment 18•9 days ago
|
||
Comment 19•9 days ago
|
||
Backed out for causing wpt failures at EventSource
Backout Link
Push with failures
Failure Log
Failure line TEST-UNEXPECTED-TIMEOUT | /eventsource/eventsource-request-cancellation.window.html | EventSource: request cancellation - Test timed out
Comment 20•1 day ago
|
||
Comment 21•21 hours ago
|
||
| bugherder | ||
Description
•