unarr/internal/agent
Deivid Soto 2b5a45674a fix(stream): report stream failures via StreamError + retry transient stat
Stream-request failures previously reported status:"failed", which the web
treated as a download failure — it left the task unstreamable and surfaced a
misleading 20s timeout. Report them through a dedicated StreamError field
instead, so the web clears the stream flag and shows the real reason without
touching the download status.

- StatusUpdate gains StreamError (json: streamError)
- OnStreamRequested reports failures via a reportStreamError helper (path
  rejected, file not found, no video in dir) instead of status:"failed"
- os.Stat is retried 3× (300ms) before giving up — NFS can transiently fail
  (ESTALE/EAGAIN/timeout), the root of the intermittent "works on the 3rd try"
- dispatch OnStreamRequested off the sync loop (goroutine): it does blocking
  I/O (stat retries, ffprobe in SetFile) that would otherwise stall task
  dispatch + status reporting for other items
2026-06-02 20:31:49 +02:00
..
active_tasks.go feat(agent): auto-resume interrupted downloads after a daemon restart 2026-05-31 22:44:05 +02:00
active_tasks_test.go feat(agent): auto-resume interrupted downloads after a daemon restart 2026-05-31 22:44:05 +02:00
client.go feat(stream): refresh expired debrid links mid-stream (hueco #2/2c) 2026-05-31 17:02:59 +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 fix(stream): report stream failures via StreamError + retry transient stat 2026-06-02 20:31:49 +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
downlink_test.go feat(agent): hybrid SSE downlink with long-poll fallback 2026-06-01 17:31:42 +02:00
events_client.go feat(agent): hybrid SSE downlink with long-poll fallback 2026-06-01 17:31:42 +02:00
events_client_test.go feat(agent): hybrid SSE downlink with long-poll fallback 2026-06-01 17:31:42 +02: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
mirror_transport.go feat(agent): give the public API client mirror failover 2026-06-01 15:53:00 +02:00
mirror_transport_test.go feat(agent): give the public API client mirror failover 2026-06-01 15:53:00 +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 refactor(sentry): decouple agent import via string-match, rename predicate 2026-05-27 17:03:26 +02:00
state_test.go fix(sentry): skip "daemon not running" stop/reload errors 2026-05-27 16:50:16 +02:00
sync.go feat(agent): hybrid SSE downlink with long-poll fallback 2026-06-01 17:31:42 +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 fix(stream): report stream failures via StreamError + retry transient stat 2026-06-02 20:31:49 +02:00