feat: Advanced call-stats REST coverage - #4
Merged
Conversation
Co-authored-by: nash <nash@getstream.io>
Co-authored-by: nash <nash@getstream.io>
Co-authored-by: nash <nash@getstream.io>
Co-authored-by: nash <nash@getstream.io>
…hunks) Co-authored-by: nash <nash@getstream.io>
Nash0x7E2
marked this pull request as ready for review
September 4, 2026 17:31
The call-session-scoped stats endpoints are keyed by the coordinator call session id (`get().call.session.id`). The integration test passed `Call::session_id()`, which is the caller's own SFU session and is reported as `user_session_id` within those payloads, so both queries returned 404. The test's unconditional 404 skip then let it pass without asserting anything, leaving the endpoints effectively uncovered. Use the call session id, replace the blanket skip with a bounded retry that still fails on a persistent 404, and assert that the returned participant session carries this join's SFU session id so the two cannot be conflated again. Also drop `resolve_sip_auth` and `resolve_sip_inbound` along with their models; these endpoints are not supported through the server client. The eight trunk and routing-rule CRUD methods are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Removes the SIP trunk and inbound routing-rule surface, its models, and its integration test, narrowing this change to the advanced call-stats REST coverage. SIP will ship separately. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`sort_query` comma-joined the encoded entries, which is not valid JSON for either a single entry or several; the coordinator rejected it with "is not a valid JSON for field 'sort'". Encode the list directly instead, and pin the array shape in a test that parses the output rather than comparing it against the encoder's own formatting. Also align the stats surface with the conventions around it: time-range request params take `Timestamp` like their siblings in `models::call`, `call_stats` paths go through a `stats_path` helper alongside `path`, and optional query params are pushed by a shared `push_opt`. The live test now populates `filter_conditions` and `limit` so the encoding is exercised end to end, and runs its two independent reads concurrently. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands the server-side video REST surface to close the coverage gap versus the reference Go server SDK (
GetStream/getstream-go), adding the advanced call statistics / reporting suite. All additions are additive — no changes to existing public API.Endpoint paths, request/response field names, and query-parameter encoding follow the existing
VideoClient/CallREST conventions and typed model style.Advanced call statistics & reporting
Application-level, on
VideoClient:get_active_calls_statusquery_aggregate_call_statsquery_call_session_statsget_daily_digestquery_user_feedbackreport_client_call_eventCall-session-scoped, on
Call:get_call_participant_session_metricsquery_call_participant_sessionsget_call_session_participant_stats_detailsquery_call_session_participant_statsget_call_session_participant_stats_timelineConsistent with the existing stats/report types, deeply nested analytics payloads are kept as
serde_json::Valuewhile envelope, identity, and pagination fields are typed.query_user_feedbacksendsfullas a query parameter and the remaining fields as the JSON body; the GET query endpoints encodefilter_conditions(JSON object) andsort(comma-joined JSON entries) the same way the Go SDK does.The call-session-scoped queries take the coordinator call session id (
get().call.session.id). This is distinct fromCall::session_id(), which is the caller's own SFU session and is reported asuser_session_idwithin these payloads.sortandfilter_conditionsare encoded as JSON query parameters (sortas a JSON array). Sorting is supported on thequery_call_session_stats/query_user_feedbackrequest bodies;query_call_session_participant_statscurrently answers any non-emptysortwithcustom sorting is not supported, which is documented on the field.Scope
SIP telephony is not part of this PR and will ship separately.
Tests
tests/video_stats.rs) that skips cleanly without credentials and deletes the call it creates on every exit path:limitandfilter_conditionsso the query-parameter encoding is validated against the server rather than only against its own unit test. Because analytics can trail the call, the queries retry on404for a bounded window and then fail — a persistent404is a test failure, not a skip.Verification
cargo fmt --all --checkcargo clippy --locked --all-targets --all-features -- -D warningscargo test --locked(full suite, live credentials configured)RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-depsAll pass.
Refs AI-769.