[Bug]: Poll voter loses their "You voted" state as soon as someone else votes
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
调研方向
Start by tracing sanitizePoll in apps/ws-server/src/utils/pollManager.ts and the poll:updated/poll:ended broadcasts in apps/ws-server/src/utils/handleMessages.ts; then follow the poll update handler in apps/frontend/src/screens/LiveQuiz.tsx and how ActivePollOverlay.tsx uses votedOptionId. Add coverage for a player voting followed by another player's update, and check that the vote selection and results remain visible through poll updates and ending.
由索引模型根据 Issue 内容生成。
描述
What happens
I vote in a live poll and see "You voted" with the results. When the next person votes, my screen goes back to the unvoted view with the Vote buttons, and the results are hidden again. Tapping an option then sends a second vote, which the server refuses with ALREADY_VOTED, and the screen does not show anything. In a room with many players this happens on almost every vote. The "Your Vote" mark is also lost when the poll ends.
Why
apps/ws-server/src/utils/pollManager.ts:76:sanitizePollsetsvotedOptionId: nullwhen it is called without a participant id.apps/ws-server/src/utils/handleMessages.ts:733-735:poll:updatedis broadcast to the whole session without a participant id (same forpoll:ended).apps/frontend/src/screens/LiveQuiz.tsx:407-414: the client does{ ...prev, ...payload.poll }, so thatnulloverwrites the voter's saved choice.ActivePollOverlay.tsxusesvotedOptionIdto decide whether to show results.
Steps to reproduce
- Host a quiz, join with two players, launch a poll.
- Player A votes. A sees "You voted".
- Player B votes. A is back to the Vote buttons.
I reproduced both sides with a throwaway vitest test (Redis and Prisma faked on the server, fake WebSocket on the frontend). Messages A receives are poll:updated (null), poll:voted (option), poll:updated (null), and after the last one the screen shows "Tap an option above to submit your vote!".
Expected
A player's own choice stays selected until a new poll starts.
Suggested fix
Leave votedOptionId out of broadcast payloads (only include it when a participant id is passed), or keep prev.votedOptionId in the client when the poll id is the same. Add a test for vote, then someone else's update.
I can fix this one if you assign it to me.
- 主要语言
- TypeScript
- 星标
- 21
- 派生
- 7
- 平均合并
- 11 小时 14 分钟
- 30 天内合并 PR
- 30
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TheCodeHeist-Coder/Rexial 的其他 Issue
-
bug level3 nsoc26
难度 2/5 1-3 小时 新手友好度 86/100
TheCodeHeist-Coder/Rexial#251 · 1 条评论 ·
维护者通常 1 天内回复
-
Lint does not block a merge, and the same test step runs twice可能已有人在做 @spikedeeev 于 7 天前认领。 未关闭Backend first issue bug good first issue help wanted level1 nsoc26
难度 2/5 1-3 小时 新手友好度 82/100
TheCodeHeist-Coder/Rexial#243 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Add CodeQL and dependency scanning so a malicious or vulnerable dependency is caught可能已有人在做 @divyanshAgarwal123 于 9 天前认领。 未关闭Backend first issue enhancement help wanted level3 nsoc26
难度 2/5 半天 新手友好度 62/100
TheCodeHeist-Coder/Rexial#242 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
fix: validate types for login email and password (500 on non-string or missing body)可能重新可做 @spikedeeev 于 16 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
TheCodeHeist-Coder/Rexial#235 · 2 条评论 ·
维护者通常 1 天内回复
-
security: remediate the dependency baseline before enforcing the audit gate可能已有人在做 @divyanshAgarwal123 于 6 天前认领。 未关闭level2 nsoc26
难度 5/5 一周以上 新手友好度 25/100
TheCodeHeist-Coder/Rexial#266 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 TheCodeHeist-Coder/Rexial 的全部 Issue
相似的 Issue
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
难度 2/5 1-3 小时 新手友好度 82/100
openclaw/openclaw#212827 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Use one constant for the 10,000-character input limit可能已有人在做 @NginxL 今天认领。 未关闭good first issue refactor
难度 2/5 1-3 小时 新手友好度 78/100
aniru-dh21/snap-validate#51 ·
维护者通常 1 天内回复
-
dependencies effort: small good first issue priority: low
难度 1/5 1-3 小时 新手友好度 88/100
TMHSDigital/screencast-mcp#509 ·
维护者通常 1 天内回复
-
from-review tech-debt testing
难度 2/5 1-3 小时 新手友好度 82/100
blamechris/chroxy#9520 ·
维护者通常 1 天内回复