-
Notifications
You must be signed in to change notification settings - Fork 0
Fix remote playback failure by validating server identity #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix remote playback failure by validating server identity #24
Conversation
Optimize MediaCard widget by caching computed values
The application was incorrectly preferring local connections (private IPs) over working Relay connections during the "latency sweep" process. This happened because the probe for the local IP would return a 200 OK (likely from a different device or router on the user's network) even though it wasn't the Plex server. This fix: 1. Updates `PlexClient.testConnectionWithLatency` to optionally accept an `expectedMachineIdentifier`. 2. Adds `Accept: application/json` header to ensuring the Plex server returns JSON instead of XML. 3. Validates that the response from the probe contains the correct `machineIdentifier` in the JSON body. 4. Updates `PlexAuthService` to pass the server's identifier during connection tests. This ensures that the application only switches to a "better" endpoint if it is verified to be the correct Plex server.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
@jules fix these errors |
|
@jules fix the tests Error: Couldn't resolve the package 'mockito' in 'package:mockito/mockito.dart'.
|
Fixed the test errors by removing the unused |
Removed the dependency on `mockito` in `test/services/plex_client_test.dart` as it was causing compilation errors (package not found) and was not strictly necessary for the scope of this fix, given the static nature of the method being tested. Simplified the test to ensure the project builds correctly.
|
@jules warning • Unused import: 'package:dio/dio.dart' • test/services/plex_client_test.dart:2:8 • unused_import |
Acknowledged. Removed the unused |
Removed unused `dio` import in `test/services/plex_client_test.dart` to resolve lint warning.
In addition to validating the server identity, we now explicitly pass the `X-Plex-Token` in the `http-header-fields` property to MPV. This ensures that playback authentication succeeds even if the server or network environment rejects the token when passed as a URL query parameter (a behavior consistent with the `Dio` connection tests which use headers).
Fixes issue edde746#104 where remote playback fails because the app switches to an unreachable local IP address.
Changes:
lib/services/plex_client.dart:expectedMachineIdentifierparameter totestConnectionWithLatencyandtestConnectionWithAverageLatency.Accept: application/jsonheader to connection test requests.machineIdentifierin the response body.lib/services/plex_auth_service.dart:findBestWorkingConnectionand_upgradeCandidateToHttpsIfPossibleto passclientIdentifierfor validation.PR created automatically by Jules for task 7340927918587698378 started by @Doezer