unarr/internal/agent
Deivid Soto 03fe5ca54a
Some checks failed
Release / release (push) Failing after 1s
Release / docker (push) Has been skipped
Release / virustotal (push) Failing after 0s
feat(agent): session-ready webhook for SSE-driven player handshake (0.9.13)
Closes Fase 3.3b. Daemon now tells the server the moment a session's
first HLS segment + init.mp4 land on disk; the web side flips
streaming_session.ready_at = NOW(), which its SSE endpoint pushes to
subscribed players so the loading UI flips from "Preparando…" to
"Stream listo" without polling HEAD on the segment URL.

Surface:
  - New Client.MarkSessionReady(ctx, sessionId) HTTP method →
    POST /api/internal/agent/session-ready.
  - New engine.HLSSession.ReadyCount() + FromCache() accessors so the
    watcher goroutine doesn't reach into private state.
  - New cmd.watchSessionReady(ctx, client, hsess, sessionId) goroutine
    polls ReadyCount every 200 ms with a 60 s deadline + short-circuits
    for cache-HIT sessions (ready the moment StartHLSSession returns).
  - Daemon callback spawns it right after streamSrv.HLS().Register so
    the watcher's lifecycle matches the session's.

Best-effort: a transient network failure on the webhook is logged + the
goroutine exits — the player's existing HEAD-probe retry path still
discovers ready state independently. The webhook is an acceleration,
not a hard dependency.
2026-05-27 14:40:53 +02:00
..
client.go feat(agent): session-ready webhook for SSE-driven player handshake (0.9.13) 2026-05-27 14:40:53 +02:00
client_test.go feat(agent): add mirror failover, agent client refactor, status 401 detection 2026-05-15 16:26:43 +02:00
daemon.go feat(agent): send full transcoder diagnostic in register payload (0.9.12) 2026-05-27 12:48:40 +02:00
disk.go feat(cli): add login command and refactor shared helpers 2026-04-01 12:20:51 +02:00
disk_test.go test(coverage): raise engine+agent coverage above 50% 2026-05-12 11:21:59 +02:00
disk_unix.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
disk_windows.go feat: initial commit — unarr CLI 2026-03-28 11:29:42 +01:00
mirror_client.go feat(mirror): update fallback URLs to use IPFS and remove GitHub Pages 2026-05-21 16:00:44 +02:00
mirror_pool.go feat(agent): add mirror failover, agent client refactor, status 401 detection 2026-05-15 16:26:43 +02:00
process_unix.go feat: add clean command to remove temp files, logs, and cached data 2026-03-29 11:04:51 +02:00
process_unix_test.go test(coverage): raise engine+agent coverage above 50% 2026-05-12 11:21:59 +02:00
process_windows.go fix(build): unused variable in Windows process check 2026-03-30 13:11:55 +02:00
state.go feat(funnel): cloudflare quick tunnel embedded subprocess (0.9.5) 2026-05-26 20:39:57 +02:00
state_test.go feat: improve daemon resilience, streaming, and usenet downloads 2026-03-28 21:36:12 +01:00
sync.go feat(funnel): cloudflare quick tunnel embedded subprocess (0.9.5) 2026-05-26 20:39:57 +02:00
sync_test.go test: add comprehensive test suite for engine, agent and cmd packages 2026-04-08 23:36:00 +02:00
taskstate.go feat(sync): replace WS+DO transport with unified HTTP sync 2026-04-08 18:50:59 +02:00
taskstate_test.go test(coverage): raise engine+agent coverage above 50% 2026-05-12 11:21:59 +02:00
types.go feat(agent): send full transcoder diagnostic in register payload (0.9.12) 2026-05-27 12:48:40 +02:00