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
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:
parent
a7aac985d2
commit
3051119405
2 changed files with 45 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue