fix(backend) defects in registration form backend - #235
Merged
Conversation
…ature. 1. Signup deadlocked. Join validates the mandatory answers, answering needs the questions, and ListQuestions required `hackathon:read` — which a non-member does not hold, since AllowPublicHackathonAccess is defined in rbac.go but never called. So a hackathon asking anything mandatory could not be joined by anyone. ListQuestions now serves a public hackathon to any caller, the same rule List already applies to the hackathons themselves; a private event still requires the grant. It also returns NotFound for an unknown id instead of an empty list. 2. ListParticipantAnswers leaked. `hasWrite` was computed but only consulted on the "no user_id" path, so naming any user id skipped the check entirely and returned what that person wrote about themselves. Reading someone else's answers is now organizer-only; reading your own still is not. 3. Bool answers could not round-trip. answerEntryFromEnt always emitted text_value, so a BOOL question read back as text_value "true" — and SubmitAnswers refuses a text answer to a bool question. Loading a form and saving it unchanged therefore failed validation on every bool question, which is what an edit form does on every save. The oneof arm now follows the question's type, which the query eager-loads. One existing test changed meaning: `ListQuestions requires Read permission` asserted the pre-fix behaviour, so it is retargeted at a private hackathon and renamed accordingly. That is the only intentional behaviour change.
Panaetius
force-pushed
the
fix/registration-form-gaps
branch
from
August 25, 2026 07:33
643171c to
bf8afbf
Compare
Panaetius
force-pushed
the
fix/registration-form-gaps
branch
from
August 25, 2026 07:53
bf8afbf to
5ae8038
Compare
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.
Signup deadlocked. Join validates the mandatory answers, answering needs the questions, and ListQuestions required
hackathon:read— which a non-member does not hold, since AllowPublicHackathonAccess is defined in rbac.go but never called. So a hackathon asking anything mandatory could not be joined by anyone. ListQuestions now serves a public hackathon to any caller, the same rule List already applies to the hackathons themselves; a private event still requires the grant. It also returns NotFound for an unknown id instead of an empty list.ListParticipantAnswers leaked.
hasWritewas computed but only consulted on the "no user_id" path, so naming any user id skipped the check entirely and returned what that person wrote about themselves. Reading someone else's answers is now organizer-only; reading your own still is not.Bool answers could not round-trip. answerEntryFromEnt always emitted text_value, so a BOOL question read back as text_value "true" — and SubmitAnswers refuses a text answer to a bool question. Loading a form and saving it unchanged therefore failed validation on every bool question, which is what an edit form does on every save. The oneof arm now follows the question's type, which the query eager-loads.
One existing test changed meaning:
ListQuestions requires Read permissionasserted the pre-fix behaviour, so it is retargeted at a private hackathon and renamed accordingly. That is the only intentional behaviour change.