Repository navigation
Require billing cleanup before account deletion - #1017
Merged
Merged
Conversation
Contributor
|
Maple development preview: https://0fadf6d1.maple-ca8.pages.dev Commit: Uses development API, billing, flags and PCR configuration. Cloudflare Access applies. |
This branch was successfully deployed
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.
Require billing cleanup before the existing account-deletion database call so a failed cancellation leaves the account and its confirmation available for an explicit retry. Once the existing confirmation checks pass, the enclave makes one bounded admin-authenticated request using its configured billing integration. Only HTTP 200 with the matching user UUID and
status: "ready"permits deletion.On failure, return a typed 503 response and show the user instructions to cancel manually and retry. The frontend recognizes that exact error contract while preserving existing local cleanup, session fences, and retry behavior. Generic OpenSecret instances without a billing integration retain their existing behavior.
The failure warning records the user UUID and a sanitized reason, including the numeric billing HTTP status. It never logs the response body or credentials.
No additional enclave database checks or changes to its existing deletion transaction; no migrations, queues, workers, automatic retries, or new credentials. Usage checks and cleanup share the existing BillingClient and one HTTP client, with redirects and automatic retries disabled for both paths. Billing must deploy its new endpoint before this caller.
Billing prerequisite: https://github.com/OpenSecretCloud/maple-billing-server/pull/109.
Validation:
2a65d4afran the deletion database regression and all 21 AEAD/database tests, plus 10 OAuth/settings/callback tests, with no skips. Subsequent changes only add sanitized failure diagnostics. Earlier local macOS SCRAM teardown failures remain recorded in the validation artifacts; the hosted CI database suite completed cleanly.Accepted Team policy: the paired billing cleanup includes a deleting owner's Team subscription. A member's deletion never cancels the administrator's subscription. No Team-specific workflow is added here.