Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A participant's answer is silently lost when their connection drops

オープン 初心者向け
#175 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
next.js, react, typescript

調査の方向性

apps/frontend/src/screens/LiveQuiz.tsx から始め、特に handleAnswer、handleStart、handleNext、および回答ボタンの disabled ロジックに注目します。選択した回答の状態を更新または送信する前に WebSocket の ready state を確認し、失敗を参加者とホストの両方に表示してください。選ぶべき方法は、拒否するか、未回答のものをキューに入れるかのどちらかです。接続に失敗した場合、回答が送信済みとして表示されないことを確認し、ホストのコントロールでも同じ失敗が表示されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

bug help wanted UI & UX

In apps/frontend/src/screens/LiveQuiz.tsx, the answer buttons are disabled only by whether an answer is already chosen:

// line ~739
disabled={Boolean(selectedAnswer) || showResults}

They are never disabled by connectionState. handleAnswer then sends with an optional chain:

// line ~414
setSelectedAnswer(answerId);            // the UI locks in immediately
const timeMs = Date.now() - questionStartTime;
ws?.send(JSON.stringify({ ... }))       // no-ops silently on a dead socket

So after the reconnect attempts are exhausted (connectionState === "failed", the red banner showing), tapping an answer still works: selectedAnswer is set, the button renders as chosen, and nothing is sent. No throw, no error.

Why it matters

The player sees their answer highlighted as submitted and waits for results. It never reached the server, so they score 0 for that question — and for every question after, since the socket is still dead. The only clue is a banner they have most likely stopped noticing.

In a graded quiz this silently destroys someone's score.

handleStart and handleNext have the same unguarded ws?.send, so a host pressing Start or Next on a failed connection also gets no feedback.

What a fix looks like
  • Disable the answer buttons when connectionState !== "connected", with a visible reason rather than just the banner.
  • Make the send path explicit about failure: check ws?.readyState === WebSocket.OPEN before sending, and surface something to the user when it is not.
  • Decide what should happen to an answer chosen while disconnected — queue it for the reconnect, or refuse the tap outright. Say which you chose in the PR.
Definition of done
  • An answer cannot be visually "submitted" when it could not be sent
  • The participant is told their connection is the problem, at the moment they try
  • Host controls behave the same way
主要言語
TypeScript
スター
21
フォーク
7
平均マージ
4時間 13分
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TheCodeHeist-Coder/Rexial のほかの issue

TheCodeHeist-Coder/Rexial の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。