A participant's answer is silently lost when their connection drops
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- next.js, react, typescript
- 领域
- frontend, networking
调研方向
从 apps/frontend/src/screens/LiveQuiz.tsx 开始,重点关注 handleAnswer、handleStart、handleNext 以及答题按钮的 disabled 逻辑。在更新所选答案的状态或发送答案之前,检查 WebSocket 的就绪状态,并让参与者和主持人都能看到失败;该 issue 没有决定是拒绝未作答的答案,还是将其加入队列。验证连接失败时不会将答案显示为已提交,并验证主持人控件也会显示相同的失败。
由索引模型根据 Issue 内容生成。
描述
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.OPENbefore 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
- 平均合并
- 3 小时 39 分钟
- 30 天内合并 PR
- 16
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TheCodeHeist-Coder/Rexial 的其他 Issue
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
TheCodeHeist-Coder/Rexial#195 ·
维护者通常 1 天内回复
-
Backend first issue bug help wanted
难度 2/5 1-3 小时 新手友好度 84/100
TheCodeHeist-Coder/Rexial#193 ·
维护者通常 1 天内回复
-
Backend first issue bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 86/100
TheCodeHeist-Coder/Rexial#192 ·
维护者通常 1 天内回复
-
Backend first issue bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 82/100
TheCodeHeist-Coder/Rexial#191 ·
维护者通常 1 天内回复
-
good first issue help wanted UI & UX
难度 2/5 1-3 小时 新手友好度 90/100
TheCodeHeist-Coder/Rexial#190 ·
维护者通常 1 天内回复
查看 TheCodeHeist-Coder/Rexial 的全部 Issue
相似的 Issue
-
[Bug]: REST API URL starting with "http" but no scheme (e.g. httpbin.org/get) is not given an http:// prefix可能已有人在做 @ItsDeadlyProgrammer 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
appsmithorg/appsmith#42471 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ehmpathy/rhachet-roles-bhrain#705 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Status: Triage
难度 2/5 1-3 小时 新手友好度 76/100
mermaid-js/mermaid#8546 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
维护者通常 1 天内回复