Skip to content

Refuse to start a quiz that has no questions - #238

Merged
TheCodeHeist-Coder merged 1 commit into
TheCodeHeist-Coder:mainfrom
harshvardhan60792:block-start-without-questions
Nov 18, 2026
Merged

TheCodeHeist-Coder merged 1 commit into
TheCodeHeist-Coder:mainfrom
harshvardhan60792:block-start-without-questions

Conversation

@harshvardhan60792

Copy link
Copy Markdown
Contributor

Part of #162.

Server side: quiz:start now checks the cached questions first. With none, it sends an error with code NO_QUESTIONS and leaves the session in WAITING, so the room never reaches the empty GET READY and COMPLETED path.

Frontend: the lobby shows that error message under the Start Game button. The button itself is not disabled up front, because the lobby still has no question count. That would need the count added to the session payload, so I left it for a follow-up.

Tests: added a case to handleMessages.auth.test.ts and made the default mock return one question. ws-server vitest passes (56). I did not typecheck or run the frontend change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants