File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import weakref
34from types import SimpleNamespace
45from typing import cast
56
@@ -142,7 +143,14 @@ async def test_local_track_republished_updates_existing_publication() -> None:
142143 packet_trailer_features = [proto_track .PTF_USER_TIMESTAMP ],
143144 )
144145 )
145- publication ._track = cast (Track , SimpleNamespace (_info = SimpleNamespace (sid = "TR_OLD" )))
146+ # Build a real Track via __new__ (bypassing FFI) so the republish handler's
147+ # track.sid invariant update and _set_room(...) re-push both work.
148+ track = Track .__new__ (Track )
149+ track ._info = proto_track .TrackInfo (sid = "TR_OLD" )
150+ track ._ffi_handle = cast (FfiHandle , None )
151+ track ._room_ref = None
152+ track ._audio_streams = weakref .WeakSet ()
153+ publication ._track = track
146154 local_participant ._track_publications [publication .sid ] = publication
147155
148156 room ._on_room_event (
You can’t perform that action at this time.
0 commit comments