-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Retry EventSource after temporary failures #41634
Copy link
Copy link
Closed
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.Straightforward. Recommended for a new contributor.I-cleanupNo impact; the issue is one of maintainability or tidiness.No impact; the issue is one of maintainability or tidiness.
Description
servo/components/script/dom/eventsource.rs
Lines 362 to 365 in a0730d7
| // The spec advises failing here if reconnecting would be | |
| // "futile", with no more specific advice; WPT tests | |
| // consider a non-http(s) scheme to be futile. | |
| match self.event_source.root().url.scheme() { |
Now that we have a NetworkError enum with more granularity, we can use the failure type to decide whether it's useful to retry an EventSource connection. Let's add a is_permanent_failure method is NetworkError which includes:
- InvalidPort
- MixedContent
- ContentSecurityPolicy
- UnsupportedScheme
Then we can call this from the EventSource code instead of the current match against the url's scheme. This is tested by ./mach test-wpt tests/wpt/tests/eventsource.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.Straightforward. Recommended for a new contributor.I-cleanupNo impact; the issue is one of maintainability or tidiness.No impact; the issue is one of maintainability or tidiness.