From e01755d9e8f57e91f2ca722a0960cbafbd7cba64 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Wed, 3 Jun 2026 12:44:21 -0400 Subject: [PATCH] zebra-spaces: drop tiles on peer-booted, same path as role-demote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boot is the noisier sibling of demote — booted users can't publish either, so their video tiles must come down immediately. The SFU-side eviction (server /internal/block + OnConnectionStateChange) propagates 'ended' eventually but lags enough that a kicked speaker's camera tile stayed visible after the boot. Authoritative removal by pubkey, same pattern as the role-change-demote fix from 1e94fa6. --- web/zebra-spaces.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index 4da0f36..33e1fc0 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -3216,7 +3216,8 @@ async function handleSignal(raw){ { const mm = members.get(m.uuid); const by = members.get(m.by); - const victPub = pubHexFromMsg(m, 'pubkey'); + const victPub = pubHexFromMsg(m, 'pubkey') + || (mm && mm.pubkey ? pubHexFromMsg({pubkey:mm.pubkey},'pubkey') : ''); const byPub = pubHexFromMsg(m, 'by_pubkey'); logLine('', idTag(m.uuid, victPub)+' was removed by '+(by||byPub?idTag(m.by, byPub):'a mod')); if (m.uuid === myUUID){ @@ -3235,6 +3236,19 @@ async function handleSignal(raw){ sfuUnsubscribe().catch(()=>{}); dropMic(); } + /* Authoritative tile teardown by pubkey — booted users can't be + * publishing anything anymore by definition. The SFU side eviction + * (server posts /internal/block, then OnConnectionStateChange -> + * removePublisher) will eventually fire 'ended' on subscribers, + * but it can lag enough that the camera tile stays visible past + * the kick. Drop it here so the boot is visually instant. */ + if (victPub){ + try { + removeScreenTile(victPub); + removeCameraTile(victPub); + removeVideoTile('gameshare', victPub); + } catch(_){} + } members.delete(m.uuid); tearPeer(m.uuid); handraise.delete(m.uuid); renderRoom(); } @@ -3989,8 +4003,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');