-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add client side validation to public forms #4529
Conversation
🧪 Review environmenthttps://n545fqpsm34is7sqhrj6y7uj7u0qmgdh.lambda-url.ca-central-1.on.aws/ |
🧪 Review environmenthttps://er6my7ulm75nda5l2k3462jbde0hqkcz.lambda-url.ca-central-1.on.aws/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I tested it and it does work as expected :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
app/(gcforms)/[locale]/(support)/unlock-publishing/components/client/Success.tsx
Outdated
Show resolved
Hide resolved
5316e9f
Summary | Résumé
Related: #4519
While investigating the recent memory leak issues, there seems to be some correlation to Contact form submissions with large amounts of invalid data.
Noted that this form (along with Support and Unlock publishing) rely exclusively on server-side validation of form inputs.
Given that Contact and Support are public-facing unauthenticated forms, it's good practice to validate both client-side and server-side. Catching validation errors client-side will prevent unnecessary round trips to the server.
Unclear if this is the specific cause of the memory leak issue, but given the correlation between Contact form submits and the recent spikes, it's a possibility to be considered, and as mentioned is just good practice.
Testing
This change affects the Contact, Support, and Unlock publishing form.
To test, visit the forms and submit some information.
The form should behave as normal.
To get a better sense of what's changed, open the Network tab of the Developer tools in Chrome.