mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-05-26 07:08:11 +00:00
When bringUpLink errored — a handshake timeout against a wedged transport, for instance — Run/RunWithReady returned straight to the caller without calling shutdown, so the carrier link that had already joined the MUC was never closed. The result was a ghost participant lingering on Jicofo/JVB until idle timeout, which the next test in the same room inherited as stale endpoints in 'bridge open'. The clue from logs was that failing seichannel runs produced one 'leave-muc handshake ok' instead of two: the server's normal ctx-cancel path got there cleanly, but the client's bringUpLink returned early and skipped its defer. Both paths now register shutdown before the bringUpLink call. shutdown is nil-safe and idempotent so it works whether or not bringUpLink actually populated link/session fields. server's wg.Wait moves into the same defer so wg goroutines spawned by partial setup also drain before Run returns.