Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

A host leaving during the countdown strands the room on GET READY!

Aperta Adatta ai principianti
#178 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
95/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nextjs, react, typescript

Direzione di ricerca

Inizia in apps/frontend/src/screens/LiveQuiz.tsx, in corrispondenza dell'handler quiz:start e della pulizia esistente del timer. Acquisisci il timer del countdown, cancellalo nella pulizia dell'effetto e proteggi l'invio del socket con readyState === WebSocket.OPEN. Verifica che lo smontaggio durante il countdown annulli l'invio e non produca alcuna eccezione non intercettata nella console.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug good first issue help wanted UI & UX

In apps/frontend/src/screens/LiveQuiz.tsx, the quiz:start handler schedules the first question three seconds later:

case "quiz:start":
    setGameState(GameState.STARTING);
    setTimeout(() => {
      if (isOrganizer) socket?.send(JSON.stringify({
        type: "quiz:next-question",
        payload: { sessionId, questionIndex: 0 }
      }));
    }, 3000);
    break;

The handle is never captured, so the effect's cleanup cannot clear it. That cleanup already clears the other three timers in this component (timeoutId, reconnectTimer, refreshTimer) — this one was missed.

Why it matters

If the host navigates away, reloads, or the component remounts inside that three-second window, the timer still fires and calls send() on a socket that is closing or closed. The first question is never broadcast.

Every participant sits on "GET READY!" indefinitely. There is no recovery from the participant side; the host has to start a whole new session.

What a fix looks like
  • Capture the handle in the same let scope as the other timers and clear it in the cleanup.
  • While in there, guard the send itself — socket?.send on a closing socket throws InvalidStateError in a real browser, so check readyState === WebSocket.OPEN first.
Definition of done
  • Unmounting during the countdown cancels the pending send
  • No uncaught exception in the console when a host leaves mid-countdown

Good first issue: a few lines, in a file that already shows the right pattern three times.

Lingua principale
TypeScript
Stelle
21
Fork
7
Merge medio
5h 43m
PR unite (30g)
30

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TheCodeHeist-Coder/Rexial

Tutte le issue di TheCodeHeist-Coder/Rexial

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.