Add poker:leave on unmount and poker:kick to remove ghost participants
All checks were successful
Build & Push Container Image / build (push) Successful in 9s

Frontend now emits poker:leave when PokerRoom unmounts, preventing
ghost participants. Also adds poker:kick socket event so any session
participant can remove a stale user — shows a small X button next to
each participant. Fixes deadlocked sessions where a disconnected user
blocks reveal (votes.size can never equal participants.size).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jan Willem Mannaerts 2026-03-03 13:54:26 +01:00
parent a7aac985d2
commit 3051119405
2 changed files with 45 additions and 7 deletions

View file

@ -343,6 +343,28 @@ io.on('connection', (socket) => {
}
});
throttled('poker:kick', async ({ sessionId, userKey }) => {
try {
if (!sessionId || !userKey) {
socket.emit('poker:error', { error: 'sessionId and userKey are required.' });
return;
}
if (!await canAccessSession(sessionId, socket.user.jiraCloudId)) {
socket.emit('poker:error', { error: 'Session not found.' });
return;
}
await leaveSession({
sessionId,
tenantCloudId: socket.user.jiraCloudId,
userKey
});
await emitSessionState(sessionId, socket.user.jiraCloudId);
} catch (error) {
console.error('[socket] poker:kick failed:', error);
socket.emit('poker:error', { error: safeError(error) });
}
});
throttled('poker:leave', async ({ sessionId }) => {
try {
if (!sessionId) return;