Skip to content

DC-477 - prevent double-submit on enrollment checker review page#365

Open
necampanini wants to merge 2 commits into
mainfrom
fix/DC-477-enrollment-checker-submit-disable
Open

DC-477 - prevent double-submit on enrollment checker review page#365
necampanini wants to merge 2 commits into
mainfrom
fix/DC-477-enrollment-checker-submit-disable

Conversation

@necampanini
Copy link
Copy Markdown
Contributor

@necampanini necampanini commented May 29, 2026

🔗 Jira ticket

DC-477

✍️ Description

Prevents double submission on the enrollment checker review page. A fast double-click on Submit could fire the check twice: the isSubmitting state flag isn't updated until React's next render, so both click handlers ran against the stale false value and both passed the guard. A synchronous useRef guard now rejects the second click immediately. The Submit button shows a loading state and the Back button is disabled while the request is in flight.

🔗 Links to related PRs

  • none

✅ Completion tasks

  • Added relevant tests
  • Meets acceptance criteria in ticket
  • Configuration changes:
    • If new environment variables are added, update in Tofu
    • If new environment secrets are added, update in Tofu and set in AWS Secret Manager
    • If you're adding an appsetting, add it to the requisite example file, and update it in the AWS AppConfig
    • If appsetttings are changed, update in AWS AppConfig

Priority Review Table

Priority File Unit Sec Cpx Nov Notes
🟡 src/SEBT.EnrollmentChecker.Web/src/app/review/page.tsx handleSubmit() + submittingRef Low Med Med sync guard blocks double-submit
🟢 src/SEBT.EnrollmentChecker.Web/src/features/enrollment/components/ReviewPage.tsx isSubmitting prop wiring Low Low Low
🟢 src/SEBT.EnrollmentChecker.Web/src/app/review/page.test.tsx new tests Low Low Low
🟢 src/SEBT.EnrollmentChecker.Web/src/features/enrollment/components/ReviewPage.test.tsx updated tests Low Low Low

<button
type="button"
className="usa-link usa-button--unstyled"
onClick={() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to disable this too along with the "Back" and "Submit" button. Maybe that's a product call, but I feel like it would make sense.

Copy link
Copy Markdown
Contributor

@noxmwalsh noxmwalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comments regarding disabling additional buttons

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants