fix(api): report direct streams as on air #368

Merged
timothy merged 2 commits from codex/99-direct-onair into main 2026-07-16 15:14:32 +02:00
Owner

Summary

  • make GET /api/v1/channels/state report onAir when either the segmenter registry or the direct-stream tracker is active for a channel
  • add handler regression coverage for direct-only activity while preserving the existing segmenter-active and inactive cases
  • update the channel-state design record from its former segmenter-only limitation to the completed universal semantics

Root cause

The direct streaming paths gained IDirectStreamSessionTracker in the first #99 slice, but GetChannelStatesForApiHandler still consulted only IFFmpegSegmenterService.IsActive. MPEG-TS direct and HLS-Direct viewers therefore remained invisible to the channel-state API despite being tracked.

Verification

  • TZ=UTC dotnet restore ErsatzTV.sln -v minimal
  • TZ=UTC dotnet build ErsatzTV.sln --no-restore -v minimal — 0 warnings, 0 errors
  • TZ=UTC dotnet test ErsatzTV.sln --no-build -v minimal — all six test projects green
  • pre-push check:api, lint, typecheck, and production web build green
  • live-E2E not required: this changes a read-only handler and no API write path

Review

Cold adversarial review passed on d1a52eaa8bd82d63d7622c039b10bbae814d2ca6. Its initial low-severity documentation finding was fixed and the fix commit was re-reviewed cleanly.

Fixes #99

## Summary - make `GET /api/v1/channels/state` report `onAir` when either the segmenter registry or the direct-stream tracker is active for a channel - add handler regression coverage for direct-only activity while preserving the existing segmenter-active and inactive cases - update the channel-state design record from its former segmenter-only limitation to the completed universal semantics ## Root cause The direct streaming paths gained `IDirectStreamSessionTracker` in the first #99 slice, but `GetChannelStatesForApiHandler` still consulted only `IFFmpegSegmenterService.IsActive`. MPEG-TS direct and HLS-Direct viewers therefore remained invisible to the channel-state API despite being tracked. ## Verification - `TZ=UTC dotnet restore ErsatzTV.sln -v minimal` - `TZ=UTC dotnet build ErsatzTV.sln --no-restore -v minimal` — 0 warnings, 0 errors - `TZ=UTC dotnet test ErsatzTV.sln --no-build -v minimal` — all six test projects green - pre-push `check:api`, lint, typecheck, and production web build green - live-E2E not required: this changes a read-only handler and no API write path ## Review Cold adversarial review passed on `d1a52eaa8bd82d63d7622c039b10bbae814d2ca6`. Its initial low-severity documentation finding was fixed and the fix commit was re-reviewed cleanly. Fixes #99
timothy added 1 commit 2026-07-16 14:59:32 +02:00
fix(api): report direct streams as on air
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 9s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 10s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 22s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 2m24s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 6m2s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 6m30s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 7m5s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
7dee5194f4
fixes #99

Co-Authored-By: OpenAI Codex <codex@openai.com>
timothy added 1 commit 2026-07-16 15:04:12 +02:00
docs(api): use versioned channel routes
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 10s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 11s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 8s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 1m14s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 3m49s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 7m47s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 6m35s
d1a52eaa8b
Co-Authored-By: OpenAI Codex <codex@openai.com>
Author
Owner

Review-verdict: MERGEABLE @ d1a52eaa8b

Cold, review-only pass found no code correctness, dependency-injection, session-keying, lifecycle, short-circuit, or test-vacuity defects. The initial low-severity documentation finding (stale unversioned channel routes) was fixed in d1a52eaa and the fix commit was re-reviewed cleanly.

Review-verdict: MERGEABLE @ d1a52eaa8bd82d63d7622c039b10bbae814d2ca6 Cold, review-only pass found no code correctness, dependency-injection, session-keying, lifecycle, short-circuit, or test-vacuity defects. The initial low-severity documentation finding (stale unversioned channel routes) was fixed in d1a52eaa and the fix commit was re-reviewed cleanly.
timothy merged commit ca5ac94466 into main 2026-07-16 15:14:32 +02:00
timothy deleted branch codex/99-direct-onair 2026-07-16 15:14:32 +02:00
Sign in to join this conversation.