Skip to content

Fix silent false-success bug in registration submit flow

Session from merchantscroll-traces on Hugging Face by vedalken · MIT · condensed by Coders Talk

17ssession
0interventions
GOAL

Run a code review on branch changes and fix any bugs found, specifically a bug where the registration form reported success even when the backend rejected the submission.

  1. Prompt · +0
    /review — asked which review to run
  2. Agent did · +0m
    Ran Bugbot review on branch changes; found a high-severity issue: submitTeam treats any HTTP 2xx as success without reading the JSON body, so the form could show success even when the backend rejected the registration.
  3. Prompt · +0m
    Fix it
  4. Agent did · +0m
    Investigated registration.js, the Apps Script backend, and existing tests to understand the response format and how submitTeam is used, then decided how to distinguish success from failure responses.
  5. Agent did · +0m
    Updated js/registration.js to parse the JSON body and only report success when success:true; also escaped result.message with escapeHtml in registration-form.js to avoid unsafe HTML insertion of server text.
  6. Agent did · +0m
    Added new unit tests covering the fixed submit path in tests/unit/registration.test.js and ran the full suite: all 102 tests passed, including 4 new ones.
  7. Outcome · +0m
    Bug fixed: submitTeam now only reports success when the backend confirms it; message output escaped; 102/102 tests passing (4 new); lints checked clean.
VERDICT

I'd start the next session the same way — running Bugbot on the branch diff before merging — since it caught a real high-severity bug I'd have missed otherwise. Asking it to just 'fix it' worked well because it investigated the backend response format and existing tests before touching code, and it proactively escaped the message HTML too. No corrections were needed this time; the agent's own research step did the work.

I tried this · 0

Discussion · 0

How Builds work