Skip to content

feat(rtc)!: move the WebRTC transport from aiortc to the Rust Video SDK - #303

Merged
dangusev merged 89 commits into
mainfrom
feature/rust-sdk-video
Oct 22, 2026
Merged

dangusev merged 89 commits into
mainfrom
feature/rust-sdk-video

Conversation

@dangusev

@dangusev dangusev commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

getstream.video.rtc no longer implements the WebRTC transport with aiortc. The
Rust Video SDK (stream-video-rust)
now does the coordinator join, the SFU selection, the SFU signaling, the peer
connections, the retries and the reconnects. The new package getstream-rtc
(import name getstream_rtc) wraps the SDK (crate getstream 0.2.0) with PyO3.

rtc.join() and ConnectionManager stay the public API. ConnectionManager is
now a thin layer: it starts the SDK join, emits the SDK events under the
existing event names, and copies the frames of aiortc tracks into the SDK.

This is a breaking change. This description lists the breaking changes compared
with 6.1.1. MIGRATION_v6_to_v7.md gives the details and the replacements.

How it works now

flowchart LR
    subgraph app["Application"]
        code["application code<br/>handlers, add_tracks()"]
        srcs["aiortc tracks<br/>AudioStreamTrack, video tracks"]
    end

    subgraph py["getstream: pure Python"]
        join_fn["rtc.join()"]
        cm["ConnectionManager"]
        ps["ParticipantsState"]
        af["AudioForwarder"]
        vf["VideoForwarder"]
    end

    subgraph ext["getstream-rtc: PyO3 extension"]
        rcall["Call"]
        evs["EventStreams<br/>sfu, coordinator, client"]
        rtrack["RemoteTrack<br/>from TrackStream"]
        ltrack["LocalAudioTrack<br/>LocalVideoTrack VP9"]
        logq["bounded log queue<br/>and forwarding thread"]
    end

    subgraph sdk["Rust Video SDK on tokio"]
        joiner["coordinator join, SFU selection,<br/>retries, reconnects, migration"]
        pcs["SFU signaling,<br/>publisher and subscriber<br/>peer connections"]
    end

    coord[("Coordinator")]
    sfu[("SFU")]
    pylog["Python logging<br/>getstream logger"]

    code --> join_fn
    join_fn --> cm
    cm -->|"join, leave, update_subscriptions,<br/>publish, stop_publish"| rcall
    rcall --> joiner
    joiner <-->|"HTTP and WebSocket"| coord
    joiner --> pcs
    pcs <-->|"signaling and media"| sfu

    pcs --> evs
    evs --> cm
    cm --> ps
    cm -->|"participant_joined, track_added,<br/>audio, custom, call_ended,<br/>connection.state_changed, ..."| code

    pcs -->|"decoded remote media"| rtrack
    rtrack -->|"next_pcm(): audio event"| cm
    rtrack -->|"video_frames()"| code

    srcs --> af
    srcs --> vf
    af -->|"write_pcm()"| ltrack
    vf -->|"write_i420_at()"| ltrack
    ltrack -->|"paced and encoded"| pcs

    sdk -.->|"tracing records"| logq
    logq -.-> pylog
Loading
  • ConnectionManager makes a getstream_rtc.Client from the API key and the
    secret (or the token) of the AsyncStream client.
  • The SDK runs on its own tokio runtime. Its async methods are awaitable from
    asyncio. Its synchronous methods release the GIL.
  • ConnectionManager opens the event streams and the track stream before the
    join, so the events and the tracks of the join are kept.
  • Rust log records go through a bounded queue. Only the forwarding thread takes
    the GIL. A log call never blocks. The first connect() starts the
    forwarding thread; an import starts no thread.

Breaking changes

Compared with 6.1.1. MIGRATION_v6_to_v7.md gives the details and the
replacements.

Installation

  • The webrtc extra installs the new package getstream-rtc (native extension). It has wheels only for Linux x86_64 and aarch64 (glibc 2.28 or later) and macOS arm64 (macOS 11 or later), and no sdist. On other platforms, for example Windows and Intel macOS, pip install "getstream[webrtc]" fails.
  • The webrtc extra no longer installs scipy, soundfile, websockets, websocket-client, structlog, tenacity and ping3.

rtc.join() and ConnectionManager

  • The signature is rtc.join(call, user_id, create=True, subscription_config=None). **kwargs and max_join_retries are removed, and other keyword arguments raise TypeError. Give data, ring, notify and video to call.get_or_create() before rtc.join().
  • user_id has no default. user_id=None raises TypeError (was ValueError). A call without an id raises TypeError.
  • connection_state returns CallingState, not the ConnectionState enum, and is read only. CallingState is not an Enum: its members have no name or value, and you cannot iterate it. RINGING and OFFLINE do not exist.
  • connect() raises (for example CoordinatorError) when the coordinator WebSocket cannot connect. 6.1.1 continued the join.
  • After a failed connect(), no connection.state_changed is emitted.
  • A second connect() on the same ConnectionManager is not supported: no events and no tracks arrive. Use a new rtc.join() for each join.
  • add_tracks() before connect() raises IllegalStateError. 6.1.1 logged an error and returned.
  • wait() also returns when the call ends or when the SDK leaves the call: after a kick or a block, an SFU error with DISCONNECT, an ICE failure, the rejoin rate limit, or too many failed negotiations.
  • Removed attributes and methods: join_response, session_id, running, local_sfu, kwargs, ws_client, publisher_pc, subscriber_pc, publisher_negotiation_lock, subscriber_negotiation_lock, twirp_signaling_client, twirp_context, stats_reporter, tracer, reconnector, pc_id(), sfu_id(), republish_tracks(), drain_video_frames.
  • Local recording is removed: start_recording(), stop_recording(), is_recording, get_recording_status(), recording_manager, the module getstream.video.rtc.recording and the recording events. Use the server recording (call.start_recording()).

Errors

  • Join errors are getstream_rtc errors, all subclasses of RustError (ApiError, CoordinatorError, PermissionDeniedError, RtcError, ConfigError, ...), not SfuJoinError or SfuConnectionError.
  • rtc.join() and ConnectionManager() raise ConfigError (or RustError) for an invalid client configuration, before connect().
  • add_tracks() raises PermissionDeniedError, IllegalStateError, MediaError or RtcError, not SfuRpcError or TimeoutError.

Events

  • Payloads are getstream_rtc classes (exported from getstream.video.rtc), not SFU protobuf messages:
    • The field type of TrackPublished and TrackUnpublished is now track_type.
    • track_type and published_tracks use TrackType. It is not an Enum; its members are equal to the protobuf integers and have the same hash.
    • participant is a RemoteParticipant. It compares by identity (compare session_id), joined_at is a Unix time float, custom is a dict, and track_lookup_prefix is removed.
    • A connection_quality or source value that the SDK does not know becomes 0.
    • TrackPublished.participant, TrackUnpublished.participant and CallGrantsUpdated.current_grants can be None.
    • ice_restart arrives after the SDK has handled the SFU request.
  • These events are not emitted: subscriber_offer, publisher_answer, ice_trickle, join_response, health_check_response, go_away, participant_migration_complete, connection_lost, reconnection_success, reconnection_failed. Watch connection.state_changed. For the participant count, use the new participant_count_changed.
  • participant_joined is also emitted for the participants that are already in the call at join.
  • call_ended is also emitted when the coordinator ends the call or the SDK leaves the call (reason 0). It is emitted only once.
  • track_published is not emitted for the tracks that existed before the join. Use track_added.
  • A handler that raises does not stop the other events. pyee sends the exception to the error event, which is also the name of the SFU Error event.

Remote media

  • track_added gives a RemoteTrack, not (track_id, kind, user). add_track_subscriber() is removed: use track.next_pcm() and track.video_frames(). video_frames() gives I420 VideoFrames, not an aiortc track.
  • ConnectionManager reads every remote audio track for the audio event. Do not call next_pcm() on these tracks.
  • A cancel of a pending next_pcm(), for example by asyncio.wait_for() with a timeout, can lose the frame that it was about to return.
  • When you drop the last reference to a remote video track, the SDK unsubscribes from it.
  • Remote H.264 video is not decoded. The SDK decodes only VP8 and VP9.

Publishing

  • add_tracks(audio=...) and add_tracks(video=...) replace the published track of the same kind. 6.1.1 added one more track. If two calls run at the same time, the second raises MediaError.
  • When the source track stops, the track is unpublished, and other participants get track_unpublished.
  • Audio:
    • Only packed s16 frames are accepted. fltp frames stop the forwarding and unpublish the track. s16p frames are sent garbled.
    • A change of the sample rate raises PcmRateMismatchError and unpublishes the track.
    • The audio is sent as mono.
  • AudioStreamTrack has pace=False by default. In 6.1.1 it sent one frame per 20 ms. Code that sends it through its own aiortc connection needs pace=True.
  • audio_buffer_size_ms below 20 raises MediaError. A negative value raises ValueError.
  • Video:
    • It is sent as VP9, not H.264.
    • The track keeps the size of its first frame. Later frames are scaled to that size.
    • STREAM_PATCH_AIORTC_BITRATES and STREAM_PATCH_AIORTC_H264_PRESET have no effect.
  • Permissions:
    • When send-audio or send-video is removed, the SDK unpublishes the track.
    • When the grant is removed, the SDK mutes the track.
    • When the permission comes back, the SDK does not publish or unmute the track again.

Resampling

  • FrameResampler and AudioStreamTrack.write() resample with the SDK windowed-sinc filter, not with PyAV:
    • When the input rate is not the output rate, 128 input frames of silence come first, and again after each flush().
    • flush() and write(..., final=True) add about 132 input frames of near-silence.
    • Mono to stereo keeps the full level (PyAV lowered it by 3 dB).
    • The channel count changes only from mono or to mono.
    • The only output format is s16.
  • PyAVResampler is removed.

participants_state

  • It gives RemoteParticipant objects keyed by session_id, and it includes the agent itself.
  • track_published does not change it and does not call the map() handlers.
  • get_user_from_track_id(), get_stream_id_from_track_id() and set_track_stream_mapping() are removed.

Subscriptions

  • role_filters also applies to the tracks that are published after the join.
  • Above max_subscriptions, a new track can take the place of a track that is already subscribed.
  • When no track matches, an empty subscription list is sent to the SFU.

Removed modules and names

  • From getstream.video.rtc: join_call_coordinator_request, JoinCallRequest, JoinCallResponse, ServerCredentials, Credentials, discover_location, HTTPHintLocationDiscovery, HEADER_CLOUDFRONT_POP, FALLBACK_LOCATION_NAME, STREAM_PROD_URL.
  • Modules of getstream.video.rtc: peer_connection, pc, encoders_patches, signaling, twirp_client_wrapper, connection_utils (with SfuJoinError, SfuConnectionError, ConnectionState), models, reconnection, network_monitor, stats_reporter, stats_tracer, tracer, coordinator, location_discovery, recording.
  • tracks.SubscriptionManager and tracks.TrackType.
  • From track_util: patch_sdp_offer, fix_sdp_msid_semantic, fix_sdp_rtcp_fb, parse_track_stream_mapping, BufferedMediaTrack, VideoFrameTracker, detect_video_properties, AudioTrackHandler, PyAVResampler.

Logging, telemetry and processes

  • The transport logs come from the getstream logger and its children, not from aiortc and aioice. Records of other Rust crates are forwarded at WARNING and above. connect() reads the logger level.
  • A process forked after rtc.join() cannot use the SDK. Fork before the first rtc.join(), or use the spawn or forkserver start method.
  • Only the OpenTelemetry spans connect, leave and rtc.add_tracks remain.

Network

  • TURN works only over UDP, as in 6.1.1. Networks that allow only TCP or TLS (for example port 443 only) cannot connect. aiortc supports TURN over TCP and TLS, but it uses only the first TURN URL, so 6.1.1 did not use them either.
  • With only a user token, the SDK cannot refresh the token. If the token expires during the call, each later rejoin or migration fails.

Installation and release

  • The webrtc extra requires getstream-rtc>=0.1.0,<0.2. getstream stays pure Python.
  • getstream-rtc has its own version and its own release-please component (tag getstream-rtc-vX.Y.Z). Its first release is 0.1.0.
  • getstream-rtc uses the crate getstream =0.2.0 from crates.io. The crate links its own static libvpx and libopus, so a build from source needs only the Rust toolchain from getstream-rtc/rust-toolchain.toml and a C compiler.

Tests and CI

  • The binding tests (getstream-rtc/tests/) and the ConnectionManager tests (tests/rtc/) join real calls.
  • New CI job: cargo fmt --check, cargo clippy -D warnings, cargo test --lib. CI requires a Cargo.lock that matches Cargo.toml.
  • The lint, type check and non-video jobs do not build the extension.
  • rtc_wheels.yml builds and checks the getstream-rtc wheels on PRs that change getstream-rtc/ or the wheel build. It uploads nothing.
  • release.yml builds each getstream-rtc wheel from the tag, checks it and uploads it before it publishes getstream.
  • examples/rtc/echo_agent.py and examples/rtc/record_audio.py use only the public getstream.video.rtc API.

Summary by CodeRabbit

  • New Features
    • Added a Rust-backed RTC client for managing calls, accessing participants and events, publishing media, receiving remote tracks, and resampling audio.
    • Added audio-recording and echo-agent examples, plus forwarding for existing audio and video tracks.
    • Audio tracks now play without pacing by default and support flush notifications.
  • Breaking Changes
    • Joining a call now requires a user ID and supports subscription configuration. Location discovery and legacy RTC interfaces, including recording controls, are no longer available.
  • Documentation
    • Added a migration guide for the updated RTC integration.

BEGIN_COMMIT_OVERRIDE
feat(rtc)!: move the WebRTC transport from aiortc to the Rust Video SDK

BREAKING CHANGE: move the WebRTC transport from aiortc to the Rust Video SDK. See #303 and the migration guide for all changes. The main changes:

  • the webrtc extra installs the new package getstream-rtc, which has wheels only for Linux x86_64 and aarch64 and macOS arm64
  • rtc.join() takes only create and subscription_config; **kwargs and max_join_retries are removed
  • connection_state returns CallingState and is read only; ConnectionState is removed
  • event payloads are getstream_rtc classes, not SFU protobuf messages, and participant is a RemoteParticipant
  • the SFU transport events and the reconnection events are not emitted; watch connection.state_changed
  • track_added gives a RemoteTrack with next_pcm() and video_frames(); add_track_subscriber() is removed
  • errors are getstream_rtc errors (subclasses of RustError), not SfuJoinError or SfuRpcError
  • add_tracks() replaces the published track of the same kind, and video is sent as VP9
  • AudioStreamTrack has pace=False by default; set pace=True to send it through your own aiortc connection
  • remote H.264 video is not decoded; the SDK decodes only VP8 and VP9
  • local recording is removed; use the server recording (call.start_recording())

Refs: #303
END_COMMIT_OVERRIDE

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

The pull request adds a Rust/PyO3 RTC package and routes Python RTC connections through it. It replaces the prior Python transport stack, adds audio and video adapters, updates audio-track and resampling behavior, and changes package configuration, CI, tests, examples, and migration documentation.

Changes: RTC transport migration

Layer / File(s) Summary
Rust package and binding API
getstream-rtc/*
Adds Rust package metadata and Python bindings for client and call lifecycle, events, participants, subscriptions, tracks, resampling, logging, and errors.
Python RTC integration and transport replacement
getstream/video/rtc/__init__.py, getstream/video/rtc/connection_manager.py, getstream/video/rtc/participants.py, getstream/video/rtc/*
Routes call lifecycle, events, participant state, subscriptions, and media publication through getstream_rtc. Removes the earlier Python transport, reconnection, recording, statistics, and discovery components.
Media forwarding and audio behavior
getstream/video/rtc/audio_forwarder.py, getstream/video/rtc/audio_track.py, getstream/video/rtc/video_forwarder.py, getstream/video/rtc/track_util.py, tests/rtc/test_*forwarder.py, tests/test_audio_stream_track.py
Adds audio and video forwarders, unpaced audio-track reads and flush notifications, and FrameResampler support for the SDK resampler.
Build, validation, examples, and migration notes
.github/*, pyproject.toml, Makefile, pytest.ini, release-please-config.json, tests/*, examples/rtc/*, migration.md, AGENTS.md
Updates Rust build and test workflows, dependency and release configuration, and test discovery. Adds RTC tests and examples, and documents the migration and Rust wrapper rules.

Priority: ⬆️ High

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PythonClient
  participant ConnectionManager
  participant RustCall
  participant RustSDK
  participant MediaForwarders
  PythonClient->>ConnectionManager: join call with user and subscription configuration
  ConnectionManager->>RustCall: create client and call
  RustCall->>RustSDK: join call and apply subscriptions
  RustSDK-->>RustCall: provide events and remote tracks
  RustCall-->>ConnectionManager: return typed events and media streams
  ConnectionManager->>MediaForwarders: start audio and video forwarding
  MediaForwarders->>RustCall: write PCM or I420 frames
  ConnectionManager-->>PythonClient: emit state, participant, and media events
Loading
Merge Risk: 🟡 Moderate · up to 0ab2b

Released RTC installations may lack the native package, and runtime cleanup or logging can fail in common edge cases; fix these before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 26.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 612 functions across 43 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main breaking change: replacing the aiortc WebRTC transport with the Rust Video SDK.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dangusev
dangusev force-pushed the feature/rust-sdk-video branch from 8805bd0 to a17f9eb Compare October 2, 2026 12:41
@dangusev dangusev changed the title Feature/rust sdk video feat(rtc)!: move the WebRTC transport from aiortc to the Rust Video SDK Oct 7, 2026
Build
- rust-toolchain.toml pins Rust 1.88, the minimum version of the Rust
  Video SDK.
- Cargo.toml builds getstream._native from rustsrc/ against the SDK
  (stream-video-rust, branch fix/compatibility-fixes).
- pyproject.toml uses maturin instead of hatchling, and uv cache keys make
  uv sync rebuild after Rust changes.
- release-please also updates the version in Cargo.toml and Cargo.lock.
- AGENTS.md lists the native build requirements.

Binding
- Client/Call: join, leave, session_id and calling_state as awaitables and
  properties; SDK errors raise Error and RtcError. join() waits until a
  cancelled join has finished its cleanup.
- events() and tracks(): async iterators that end when the call ends;
  participants() and call_state().
- Media: RemoteTrack.next_pcm()/next_video_frame() return numpy arrays
  without a copy; LocalAudioTrack/LocalVideoTrack, publish_audio(),
  publish_video() and update_subscriptions().

Logging
- SDK tracing events and third-party log records reach Python logging
  through a bounded queue and one forwarding thread, so a thread that logs
  never waits for the GIL.
- configure_logging(logger, level, third_party_level=WARNING); records keep
  the time of the Rust event.
- Client(log_bodies=True) logs redacted request and response bodies.
SDK logs are now visible in pytest runs
Fewer requests get sent to the backend this way
- Call.stop_publish_audio, stop_publish_video, stop_publish_screen_share
- Call.publish_screen_share (VP8)
- LocalAudioTrack(pcm_queue_capacity) in seconds
- __repr__ for participants, events, remote tracks and frames
- AGENTS.md: sdk_logs is for assertions on records
- Emit SFU events, coordinator custom events, connection state changes,
  call_ended, track_added and audio from the SDK event and track streams,
  with stream-py payload classes instead of protobuf.
- Join with an API secret or a user token; apply subscription configs.
- Publish aiortc audio and video tracks through AudioForwarder and
  VideoForwarder (VP9 video, mono audio, unpaced AudioStreamTrack option).
- Key participants_state by session_id, include the local participant and
  refill it after lost events.
- Add RemoteTrack.video_frames(): an independent latest-frame stream for
  each reader, in place of next_video_frame().
- Remove local recording.
- Add migration.md with the breaking changes versus 4.1.0.
Consumers import RemoteTrack, RemoteParticipant, TrackType,
VideoFrameStream, VideoFrame and the emitted event classes from the public
package instead of getstream._rust.
- A new video track reuses the stopped video sender; test added.
- Set the extension version to 6.1.1, as in pyproject.toml.
- Document the 20 ms minimum PCM queue and video republishing.
- add_tracks unpublishes the earlier audio or video track before it
  publishes a new one, so a new track no longer fails with MediaError
  when the earlier one is live or not yet unpublished.
- Bump the Rust SDK revision to 147e04a.
- Delete the old join, signaling, reconnection and peer connection code
  and the attributes and methods that only it used.
- rtc.join takes subscription_config explicitly; max_join_retries,
  drain_video_frames and other keyword arguments are removed.
- Delete the peer connection, signaling, coordinator WebSocket,
  reconnection, stats, tracer, location discovery and aiortc encoder
  patch modules with their tests.
- Keep only the subscription config dataclasses in tracks.py and the
  audio helpers in track_util.py.
scipy, soundfile, websockets, websocket-client, structlog, tenacity and
ping3 were used only by the deleted aiortc transport code.
A remote track that is dropped during a mute is delivered again as a new
track_added when its media flows after the republish.
It plays back the browser participant's audio and shows their camera
mirrored, through rtc.join, the audio and track_added events,
RemoteTrack.video_frames() and add_tracks.
When the call ends without leave(), the SDK stops the published tracks.
The forwarders kept writing, and the publish task ended with an
IllegalStateError that nothing retrieved.
It writes the audio event of each participant session to its own WAV
file.
- Cast the aiortc frames and their arrays to the types that the
  forwarders write.
- Narrow the coordinator and client events by their class.
- Require user_id in rtc.join and ConnectionManager, and raise TypeError
  for a call without an id.
The SDK tasks keep a joined call alive, so a Call that Python freed without leave() stayed in the call until the process exited. Its Drop now starts leave() on the runtime; it takes no SDK lock with the GIL held.
The SDK also rejects a call_event_capacity above 65536.
The tracks of a call stay in its queue after the call ends, so after a new join of the same Call, a new TrackStream first gave the dead tracks of the earlier join. join() now drops them before the SDK join, in Idle or Left only. The drop does not wait for the queue lock: a stream that holds it waits for a track, so the queue is empty, and ConnectionManager reads tracks before it joins. The TrackStream stub also documents the RtcError after a queue overflow.
The failure path of connect() cancels the event tasks, so nothing set the stop event, and wait() did not return. It is now set before the leave, so a cancellation during the leave cannot block wait() either.
The check for aiortc came after the imports of getstream_rtc and of modules that import aiortc, so a missing webrtc extra gave "No module named 'getstream_rtc'" instead of the pip install hint. The check now covers both imports and comes first.
The four WAV files over 256 KB in tests/assets had no user, and
scripts/create_test_assets.py only made two of them. test_connection_manager
loaded .env at import although the session fixture load_env already does,
test_frame_timing requested an unused monkeypatch, and the custom event test
was outside a class with an unannotated fixture.
test_cancelled_join_allows_new_join cancelled after a fixed 0.1 s, so a join
that completed faster made pytest.raises(CancelledError) fail. The test now
cancels when client_events() gives JOINING, while the join is in progress.
The members compare equal to their int values but had no hash, so they could
not be dict keys or set members, and set(participant.published_tracks) raised
TypeError, unlike the 6.1.1 values. __hash__ now returns the int value, which
keeps the hash consistent with that equality. The stub declares plain classes
instead of Enum, so type checkers reject name, value and iteration, which do
not exist at runtime.
Only scripts/create_test_assets.py used them, and it is deleted.
When the source of a published track ended, its forwarding task awaited the
SDK stop in finally. An add_tracks() at that moment cancelled the task, and
the cancel dropped the SDK stop: the old track kept the only publish option
of its kind, so the new publish and every later one raised MediaError until a
reconnect or a leave. The task now shields the stop and, on a cancel, waits
for it before it raises.
The LocalAudioTrack capacity docstring now names the ValueError for a
negative, infinite or NaN value. The audio forwarder comment no longer says
that aiortc's Opus encoder accepts only s16, two ConnectionManager comments no
longer refer to the aiortc version, and the video forwarder explains that
duration is an estimate from the previous gap.
test_no_records_after_logging_is_stopped could not fail: the autouse fixture
forwards at INFO, so the DEBUG overflow record was filtered also with
forwarding on. It now uses sdk_logs. Two event loops passed with no assertion
when the stream ended early; they now fail. The cancelled writer tasks are
awaited, so a writer error shows in the result, and the receivers that waited
without a timeout now time out.
The test functions of the rtc test files had no return type, and the client
fixture of test_connection_manager had none either.
A live check showed that on a kick or a block the SFU sends call_ended (reason
KICKED) and an error with code 403 and no reconnect strategy, not DISCONNECT,
and that the SDK leaves because of the call_ended. With block=True the state
passes RECONNECTING before LEFT. The "Not verified" section is removed: the
event names match the SDK, and no path waits for the GIL while it holds an SDK
lock.
No test used mia.mp3, mia.json, formant_speech_16k.wav, speech_tone.wav or
test_tone_16k.wav. mia.mp3 and mia.json were only the input of the deleted
scripts/create_test_assets.py.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c49760. Configure here.

Comment thread getstream-rtc/rustsrc/call.rs Resolved
Comment thread getstream-rtc/rustsrc/tracks.rs Resolved
Python 3.10 to 3.12 call Handler.release() in Handler.handle(). The Event
attribute of the same name made each record raise TypeError, so caplog did
not get the records.
The SDK replaced LocalVideoTrack::write_i420, which took the length of a
frame, with write_i420_at, which takes its pts. The binding follows as
LocalVideoTrack.write_i420_at(data, width, height, pts). The SDK set the RTP
timestamp of the next frame from the length, and the forwarder could only
give the gap to the previous frame, so after a change of the frame rate each
timestamp was one frame late. The forwarder now gives each frame the sum of
the gaps to it, so the RTP timestamps keep the spacing of the source times; a
frame without a later time than the previous one still comes 1/30 s after it,
because the SDK drops a frame whose pts does not increase.
Its last item, the loss of an item when a pending read is cancelled, affects
only code that reads the getstream_rtc streams directly. The docstrings of
EventStream, TrackStream and RemoteTrack.next_pcm describe it.
The crate has the same code as 0.2.0-preview.1; only the version changes.
The name matches MIGRATION_v2_to_v3.md. The guide gives the install command for 7.x and the getstream-rtc requirement, and states that a cancelled next_pcm() can lose a frame.
Each SHA is the commit that the earlier major tag pointed to; the comment gives its full version.
aiortc supports TURN over TCP and TLS, but it uses only the first TURN URL, so the UDP-only TURN of the SDK is not a change compared with 6.1.1.
@dangusev
dangusev merged commit 206c695 into main Oct 22, 2026
24 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants