feat: tick-scoped notice buffer flushed after wait message - #574
Conversation
Add an in-memory notice buffer in the Go client that collects user-facing warnings and errors during each tick and flushes them after the wait line, so docker compose logs show actionable messages at the bottom of each cycle. Improve GetStream error propagation from the Python server with clear messages for quality mismatches (414), format failures (415), and offline channels (450). Format fallback warnings are sent via gRPC metadata. Includes Go and Python unit tests plus integration test phases 6a (Twitch) and 6b (Kick). Closes #573 Co-authored-by: Josh J <josh@joshjacobs.net>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughAdds a deduplicating in-memory tick notice buffer ( ChangesTick Notice Buffer and gRPC Warning Propagation
Sequence Diagram(s)sequenceDiagram
participant TickLoop as streamdl.go tick loop
participant GoGRPC as getStream (grpc_client.go)
participant PySrv as StreamServicer (streamdl_proto_srv.py)
participant Buffer as tickNotices (noticeBuffer)
TickLoop->>GoGRPC: getStream(site, user, quality)
GoGRPC->>PySrv: GetStream RPC (grpc.Header capture)
PySrv-->>GoGRPC: x-streamdl-warning header + StreamResponse or gRPC error with detail
GoGRPC-->>TickLoop: StreamURLs{Video, Audio, Warning} or error
TickLoop->>Buffer: Warn/Error(channel, message)
Note over Buffer: deduplicates by channel|message key
TickLoop->>Buffer: Flush(tickTime)
Buffer-->>TickLoop: logs notices at warn/error level after wait line
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Recreate only the client with --no-deps so Phase 6 notice checks still run after a VOD failure, and fix Compose v5 healthcheck quoting.
yt-dlp returns IDs like v2807766672; prepending videos/ produced twitch.tv/videos/v2807766672 which fails resolution.
Fixes #573
Summary
Adds an interim notification surface for StreamDL: user-facing warnings and errors are buffered during each tick and flushed after the
Waiting … until next checkline, sodocker compose logssurfaces actionable messages at the bottom of each idle period — without requiring debug log level or a full TUI.Changes
Go client
Noticerinterface and tick-scoped notice buffer (notice.go)Currently Live Userssummary and INFO-level wait lineClearChannelon live session end)GetStreamfailures, format fallback warnings, VOD resolve failures, and FFmpeg failures through the notice bufferx-streamdl-warningmetadata to the clientPython server
messagefield on GetStream errors (quality mismatch, offline, format failure)414(quality not available) with available Streamlink keysTests
pytest tests/alongside existing bandit scanExample output (INFO level)
Testing plan
twitch.tv)kick.com)Follow-ups (out of scope)
Summary by CodeRabbit
New Features
Bug Fixes
Tests