Skip to content

fix(backend) defects in registration form backend - #235

Merged
Panaetius merged 2 commits into
mainfrom
fix/registration-form-gaps
Aug 25, 2026
Merged

fix(backend) defects in registration form backend#235
Panaetius merged 2 commits into
mainfrom
fix/registration-form-gaps

Conversation

@sabinem

@sabinem sabinem commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator
  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.

…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.
@sabinem sabinem changed the title Fix defects in registration form backend Fix(backend) defects in registration form backend Aug 25, 2026
@sabinem sabinem changed the title Fix(backend) defects in registration form backend fix(backend) defects in registration form backend Aug 25, 2026
@Panaetius
Panaetius force-pushed the fix/registration-form-gaps branch from 643171c to bf8afbf Compare August 25, 2026 07:33
@Panaetius
Panaetius force-pushed the fix/registration-form-gaps branch from bf8afbf to 5ae8038 Compare August 25, 2026 07:53
@Panaetius
Panaetius merged commit 08d3d99 into main Aug 25, 2026
2 checks passed
@Panaetius
Panaetius deleted the fix/registration-form-gaps branch August 25, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants