fix(plex): validate a failover candidate before switching the live endpoint
A transient GET failure on a healthy endpoint could park the client on an unreachable fallback (e.g. the server host's Docker bridge gateway, which plex.tv advertises as a local connection) for a full connect timeout, failing every request in flight during that window (log bbr90). The cascade now probes each candidate with an unauthenticated /identity request under the discovery-race budget and only switches when it answers as the expected server, mirroring the Jellyfin trust gate. Unreachable-looking private IPv4 candidates stay in the list — a client on the server host can legitimately reach them, so reachability is probed, not inferred.
This commit is contained in:
@@ -149,6 +149,8 @@ PlexClient testPlexClient({
|
||||
http.Client? httpClient,
|
||||
Future<http.Response> Function(http.Request request)? handler,
|
||||
List<String>? prioritizedEndpoints,
|
||||
http.Client Function()? endpointProbeHttpClientFactory,
|
||||
void Function()? onAllEndpointsExhausted,
|
||||
List<({String identifier, String gridEndpoint})> epgProviders = const [],
|
||||
String? homeHubKey,
|
||||
String? promotedHubKey,
|
||||
@@ -163,6 +165,8 @@ PlexClient testPlexClient({
|
||||
serverName: serverName,
|
||||
httpClient: httpClient ?? MockClient(handler ?? _defaultResponse),
|
||||
prioritizedEndpoints: prioritizedEndpoints,
|
||||
endpointProbeHttpClientFactory: endpointProbeHttpClientFactory,
|
||||
onAllEndpointsExhausted: onAllEndpointsExhausted,
|
||||
epgProviders: epgProviders,
|
||||
homeHubKey: homeHubKey,
|
||||
promotedHubKey: promotedHubKey,
|
||||
|
||||
Reference in New Issue
Block a user