Files
client/docs/evidence/native-stream-setup-cancelled-registration.md
T
omar 6ab51d5fb0 Keep cancelled stream setup in its publisher slot
Prevent a replacement from inheriting the cancelled publication’s late stream ID.
Cover the cancellation and unregister ordering in the offline native publisher tests.
2026-11-28 07:26:25 +03:00

1.9 KiB

Native P2P stream setup: cancelled registration

Windows x64; branch work/stream-setup, base caf29f4. The isolated worktree kept the output in its own target/ and used the existing prebuilt WebRTC dependency.

notifystreamstarted supplies the publishing client ID and assigned stream ID, not the setup request identity. A replacement used to take the same tab's publisher slot after local cancellation but before the old start notification arrived. The chooser and the slot reservation now refuse a replacement while the cancelled setup is unresolved. The source stops immediately; the old publisher keeps ownership of the late ID and sends stopstream for it. The slot can be reused once that command has completed, or after the old server session is gone. The raw command schema is unchanged.

Command (Visual Studio x64 environment, with CARGO_TARGET_DIR set to the isolated target/):

cargo test --locked --offline -p teamspeach-native --lib --no-default-features --features webrtc publisher_

Result: 13 passed, 0 failed in the isolated worktree after resuming from the partial dependency build. The new hub-level regression exercises cancellation before the setup reply, blocks reuse before the late ID and during unregister, verifies one stop for the old ID, and then reserves a fresh publisher without an ID. The existing early-ID regression still checks that setup acceptance is required for Live and that refusal releases the source. Both use in-process signaling fixtures, not a running server. The earlier attempt in the primary checkout timed out during dependency setup; no test result came from that attempt.

Not exercised here: the real OS source chooser, its no-capture-until-Preview boundary, physical capture consent, or a real server refusal rendered by the chooser workflow. No beta14 fixture, network connection, real device, or owner profile was used. command:stream_setup remains pending.