Repository navigation
Conversation
TheCodeHeist-Coder
approved these changes
Oct 30, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
If a participant's socket had dropped, tapping an answer used to mark it as chosen even though nothing was sent.
ws?.sendon a closed socket does nothing and doesn't throw, so the answer was lost without any sign. The host's Start and Next controls had the same problem.LiveQuiz.tsxnow all go through onesendMessage()helper. It checksws.readyState === WebSocket.OPENand returns whether the message was sent.role="alert"message appears beside the control. The answer stays selectable, so the participant can try again.connectionStateis not'connected', and the reason is shown next to them.handleNextonly advancesqIndexafter the send succeeds, so a failed Next no longer skips a question.timeMswould no longer mean anything.quiz:next-questionsent 3s afterquiz:start, because no user tap is involved.No screenshots: the only visual change is one line of red helper text under the disabled controls, using the existing
text-red-400style.Related issue
Closes #175
Type of change
Which services does this touch?
apps/frontendapps/http-serverapps/ws-serverapps/genAIpackages/db(schema or Prisma changes)How did you test this?
New component tests in
LiveQuiz.test.tsxuse theFakeSocketstub. They cover:onclosefiresCommands run:
cd apps/frontend && npx vitest run: pass (9 files, 89 tests)LiveQuiz.tsxfrommain. As expected, 4 of them fail there, and they pass with the fix.pnpm run check-types --force: pass (9/9 tasks)pnpm run build --filter='!admin' --filter='!admin-server' --force: pass (5/5 tasks)npx eslint src/screens/LiveQuiz.tsx src/screens/LiveQuiz.test.tsx: 6 errors and 1 warning, the same as onmainand all on untouched lines. Nothing new (CI lint is report-only).Not checked in a browser, and not tested with more than one participant. The behaviour is covered only by the component tests.
Checklist
pnpm run lint(only raneslinton the two changed files; see above)pnpm run check-typespnpm run build(ran it withoutadminandadmin-server; see above)docker-compose up.envfile, API key or other secret