refactor: pin the look-alike code paths that must not be merged

Several pairs of near-identical code paths differ in one load-bearing
line. Each site now carries a comment naming the invariant that forces it
apart, backed by a characterization test so a future deduplication fails
loudly instead of silently changing behaviour.

Pinned: focusable wrapper vs. chip D-pad activation policy, profile
connection cleanup's raw-id vs. ServerId-typed server projections, live TV
tab loaders, video player display matching and playback service wiring,
track selection container ordering, tracker HTTP client status ladder, and
the MediaServerHttpClient shutdown/cancellation contract versus
ManagedHttpClient's closing guard.

New tests:
  test/focus/dpad_activation_policy_test.dart
  test/services/track_selection_container_ordinal_test.dart
  test/services/trackers/tracker_status_ladder_test.dart
  test/utils/media_server_http_client_shutdown_test.dart
This commit is contained in:
edde746
2026-07-26 06:09:47 +02:00
parent 4307c49cd2
commit 04d8070fd4
24 changed files with 419 additions and 2 deletions
+3
View File
@@ -14,6 +14,9 @@ Future<http.Response> sendAbortableHttpRequest(
Future<void>? abortTrigger,
String? operation,
}) {
// Deliberately not `AbortController`: that type lives with the media-server
// client and throws `MediaServerHttpException`, which the tracker/Seerr
// callers of this helper must stay independent of.
final abort = Completer<void>();
void abortRequest() {
if (!abort.isCompleted) abort.complete();