Skip to content

Retry EventSource after temporary failures #41634

@jdm

Description

@jdm

// 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.

Metadata

Metadata

Labels

A-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.I-cleanupNo impact; the issue is one of maintainability or tidiness.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions