-
Notifications
You must be signed in to change notification settings - Fork 82
(BIO) In Progress forms get deleted on successful claim creation. #25447
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR fixes a bug where in-progress forms were not being deleted after successful form submissions, leaving orphaned data in the database. The fix adds clear_saved_form(claim.form_id) calls to four form controllers after successful claim creation or PDF generation.
- Added in-progress form cleanup to Form 21-0779, 21P-530A, 21-4192, and 21-2680 controllers
- Implemented comprehensive test coverage verifying forms are deleted on success but preserved on failure
- Maintains proper error handling to ensure cleanup only occurs after successful operations
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/controllers/v0/form21p530a_controller.rb | Added clear_saved_form call after successful claim creation in the create action |
| app/controllers/v0/form214192_controller.rb | Added clear_saved_form call after successful claim creation in the create action |
| app/controllers/v0/form212680_controller.rb | Added clear_saved_form call after successful PDF generation in the download_pdf action |
| app/controllers/v0/form210779_controller.rb | Added clear_saved_form call after successful claim creation in the create action |
| spec/controllers/v0/form21p530a_controller_spec.rb | Added tests verifying InProgressForm cleanup on success and preservation on failure |
| spec/controllers/v0/form214192_controller_spec.rb | Added tests verifying InProgressForm cleanup on success and preservation on failure |
| spec/controllers/v0/form212680_controller_spec.rb | Added tests verifying InProgressForm cleanup on success and preservation on failure |
| spec/controllers/v0/form210779_controller_spec.rb | Added tests verifying InProgressForm cleanup on success and preservation on failure |
annaswims
left a comment
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 great!
Summary
Fixed a bug where in progress forms remained even after the veteran successfully submits their form.
Related issue(s)
Testing done
Screenshots
Before:

After:
What areas of the site does it impact?
This PR affects Form 21-0779, Form 21p-530a, and Form 21-4192 create endpoints and Form 21-2680 download_pdf endpoint.
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?