Skip to content

[Bugfix:System] Preserve signup fields#12939

Merged
bmcutler merged 3 commits into
Submitty:mainfrom
RohanOnKeys:codex/fix-signup-field-preservation
Jun 26, 2026
Merged

[Bugfix:System] Preserve signup fields#12939
bmcutler merged 3 commits into
Submitty:mainfrom
RohanOnKeys:codex/fix-signup-field-preservation

Conversation

@RohanOnKeys

@RohanOnKeys RohanOnKeys commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

What is the current behavior?

When server-side validation rejects the self-account creation form, the redirect back to the signup page clears every field. This includes failures that cannot be prevented by client-side validation, such as duplicate user IDs or email addresses.

What is the new behavior?

The controller stores only the submitted email, user ID, given name, and family name for the redirect request. The signup form consumes those values once and repopulates the corresponding fields.

Password and confirmation values are intentionally never stored or repopulated.

This keeps server-side validation authoritative and covers every existing validation/error redirect rather than only rules that can be duplicated in JavaScript.

Testing

The self-account-creation Cypress flow now verifies that:

  • all four non-password fields remain populated after an invalid email-domain response;
  • password and confirmation fields are empty after the redirect;
  • subsequent validation paths can replace the preserved values cleanly.

Local checks: git diff --check and JavaScript syntax validation passed. Full PHP lint and Cypress execution require the Submitty development environment and are left to CI.

Closes #12490

This is a server-side replacement for the incomplete client-side approach in #12679.

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.40%. Comparing base (3dcf453) to head (81f4ec8).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12939      +/-   ##
============================================
- Coverage     21.40%   21.40%   -0.01%     
- Complexity     9944     9945       +1     
============================================
  Files           268      268              
  Lines         37124    37131       +7     
  Branches        494      494              
============================================
  Hits           7948     7948              
- Misses        28686    28693       +7     
  Partials        490      490              
Flag Coverage Δ
autograder 21.16% <ø> (ø)
js 2.01% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.44% <0.00%> (-0.01%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dandrecollins07-ctrl dandrecollins07-ctrl left a comment

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.

Please fix the title name.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jun 23, 2026

@dandrecollins07-ctrl dandrecollins07-ctrl left a comment

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.

Tested on main and PR branch.

On main, triggering a server-side validation error ("This email is not accepted") cleared all form fields after redirecting back to the signup page.

On the PR branch, the email, user ID, given name, and family name fields remained populated while the password and confirm password fields were correctly cleared.

Also verified that duplicate-account validation preserves the non-password fields as expected.

@github-project-automation github-project-automation Bot moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development Jun 23, 2026
@RohanOnKeys RohanOnKeys changed the title [Bugfix:System] Preserve Sign Up fields after validation errors [Bugfix:System] Preserve signup fields Jun 24, 2026
@RohanOnKeys
RohanOnKeys deleted the codex/fix-signup-field-preservation branch June 24, 2026 08:16
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Jun 24, 2026
@dandrecollins07-ctrl

Copy link
Copy Markdown
Contributor

@RohanOnKeys I saw that you closed the PR, but created a new one with just an edit in the Testing.

If that was all that was changed, you can just edit the message here and reopen the PR as the code is identical, and seems to fix the issue it's intended to.

@RohanOnKeys
RohanOnKeys restored the codex/fix-signup-field-preservation branch June 25, 2026 09:46
@RohanOnKeys RohanOnKeys reopened this Jun 25, 2026
@RohanOnKeys

Copy link
Copy Markdown
Contributor Author

Looks like the latest workflow runs need maintainer approval before they can start. I don't have permission to rerun them from my side.

@RohanOnKeys

Copy link
Copy Markdown
Contributor Author

Cypress E2E tests with pam auth is failing everytime

@dandrecollins07-ctrl

Copy link
Copy Markdown
Contributor

Cypress E2E tests with pam auth is failing everytime

Hi, may you please put the original description back? This will be important for future reviewers to properly understand.

@RohanOnKeys

Copy link
Copy Markdown
Contributor Author

Doneee..

@bmcutler bmcutler moved this from Done to Ready to Merge in Submitty Development Jun 26, 2026
@bmcutler
bmcutler merged commit 051b73b into Submitty:main Jun 26, 2026
@github-project-automation github-project-automation Bot moved this from Ready to Merge to Done in Submitty Development Jun 26, 2026
@RohanOnKeys
RohanOnKeys deleted the codex/fix-signup-field-preservation branch June 26, 2026 12:13
jndlansh pushed a commit to jndlansh/Submitty that referenced this pull request Jul 1, 2026
### What is the current behavior?

When server-side validation rejects the self-account creation form, the
redirect back to the signup page clears every field. This includes
failures that cannot be prevented by client-side validation, such as
duplicate user IDs or email addresses.

### What is the new behavior?

The controller stores only the submitted email, user ID, given name, and
family name for the redirect request. The signup form consumes those
values once and repopulates the corresponding fields.

Password and confirmation values are intentionally never stored or
repopulated.

This keeps server-side validation authoritative and covers every
existing validation/error redirect rather than only rules that can be
duplicated in JavaScript.

### Testing

The self-account-creation Cypress flow now verifies that:

- all four non-password fields remain populated after an invalid
email-domain response;
- password and confirmation fields are empty after the redirect;
- subsequent validation paths can replace the preserved values cleanly.

Local checks: `git diff --check` and JavaScript syntax validation
passed. Full PHP lint and Cypress execution require the Submitty
development environment and are left to CI.

Closes Submitty#12490

This is a server-side replacement for the incomplete client-side
approach in Submitty#12679.

Co-authored-by: Barb Cutler <[email protected]>
prestoncarman added a commit that referenced this pull request Jul 1, 2026
* main: (78 commits)
  [Bugfix:TAGrading] Auto-open single file (#12625)
  [Feature:InstructorUI] Add sortable columns to manage students (#12957)
  [Dependency] Bump php-ds/php-ds from 1.7.0 to 2.0.1 in /site (#12827)
  [Refactor:TAGrading] Events Infrastructure & StatusBanner (#12941)
  [Dependency] Bump sqlalchemy from 2.0.48 to 2.0.51 in /.setup/pip (#12884)
  [Bugfix:Developer] trust hashicorp for vagrant install (#12968)
  [Feature:TAGrading] Backend for submission clustering (#12886)
  [Bugfix:InstructorUI] Missing Subsection in the Edit User form (#12955)
  [Bugfix:Submission] Warning Banners Accessibility Fix (#12956)
  [Bugfix:System] Preserve signup fields (#12939)
  [Bugfix:InstructorUI] Fix Csv Download of Subsections (#12954)
  [Bugfix:InstructorUI] Fix Manage Students Toggle Columns (#12953)
  [Feature:TAGrading] Persistent Auto-Open (#12931)
  [Bugfix:Submission] Dot File Upload (#12924)
  [Refactor:System] Declutter workers (#12815)
  [Bugfix:Developer] save/restore autograding_containers.json (#12952)
  [Bugfix:InstructorUI] Create Course Validation (#12949)
  [Testing:Notifications] Fix grade_inquiries.spec.js (#12950)
  [UI/UX:System] Add fullscreen button vue component (#12936)
  [Bugfix:TAGrading] Student Name Resize (#12946)
  ...

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

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Fix Sign Up form clearing fields on validation error

4 participants