Public Webforms: Sandbox cleanup - #1793
Merged
Merged
Conversation
3 tasks
nospame
changed the base branch from
ejp/public-webforms-confinement
to
ejp/public-webforms-base
July 28, 2026 17:52
nospame
changed the base branch from
ejp/public-webforms-base
to
ejp/public-webforms-confinement
August 11, 2026 16:25
nospame
marked this pull request as ready for review
August 11, 2026 16:27
nospame
force-pushed
the
ejp/public-webforms-cleanup
branch
from
August 11, 2026 16:40
481c5c7 to
88c6f87
Compare
nospame
force-pushed
the
ejp/public-webforms-cleanup
branch
from
August 11, 2026 18:03
88c6f87 to
283c072
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1793 +/- ##
============================================
+ Coverage 70.59% 70.67% +0.07%
- Complexity 2094 2100 +6
============================================
Files 260 260
Lines 8119 8132 +13
Branches 794 796 +2
============================================
+ Hits 5732 5747 +15
+ Misses 2096 2094 -2
Partials 291 291 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nospame
force-pushed
the
ejp/public-webforms-cleanup
branch
from
August 11, 2026 19:47
c810177 to
da9444f
Compare
nospame
requested review from
MartinRiese
and removed request for
dannyroberts
September 10, 2026 23:31
MartinRiese
approved these changes
Sep 15, 2026
nospame
force-pushed
the
ejp/public-webforms-cleanup
branch
from
September 16, 2026 18:11
da9444f to
cc95836
Compare
Extract the post-submit cleanup into a package-private onSuccessfulSubmitso its public and regular branches are unit-testable without the fullsubmit orchestration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nospame
force-pushed
the
ejp/public-webforms-cleanup
branch
from
September 16, 2026 18:22
cc95836 to
176ec7d
Compare
MartinRiese
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Technical Summary
synthetic user, creating a persistent on-disk sandbox that is never reused once the one-time link
is consumed. This PR deletes that sandbox on successful submit so they don't accumulate.
FormSubmissionHelper: on a confirmed submit (where the form session is deleted — the point HQfires
consume_public_form_session), a public session marks its request-scopedRestoreFactoryfor cleanup.
UserRestoreAspect#closeRestoreFactory: deletes the sandbox folder after the connection isclosed, best-effort. Removing the one user folder reclaims both the user DB and the nested app DB.
the auto-submit-on-
get_endpointpath. Identity is the HQ-pinned restore user, neverclient-supplied — which is why this is server-side rather than exposing
clear_user_data.Code and this description written or co-written by AI and edited by human.
Safety Assurance
Safety story
Scope is tightly bounded: cleanup only fires for a public session, only on a successful submit, and
deletes only that session's own single-use sandbox (identity taken from the pinned
RestoreFactory,never the request body). Deletion happens after the connection closes and is wrapped best-effort, so
a cleanup failure logs and never fails the submit. No regular-user or shared data is touched.
Automated test coverage
UserRestoreAspectTest— marked → sandbox deleted after close; not marked → left intact; deletefailure is swallowed. (Verified locally: passing.)
QA Plan
This particular change will not get QA.
Special deploy instructions
Rollback instructions
Review