Skip to content

fix: fail close account-deletion Cloud Tasks dispatch#9768

Merged
Git-on-my-level merged 2 commits into
mainfrom
codex/account-deletion-fail-closed
Jul 15, 2026
Merged

fix: fail close account-deletion Cloud Tasks dispatch#9768
Git-on-my-level merged 2 commits into
mainfrom
codex/account-deletion-fail-closed

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #9760.

  • Makes production account deletion fail closed: a deletion intent is durably recorded with an opaque wipe job ID before the wipe can be dispatched, and production startup rejects inline or incomplete Cloud Tasks configuration.
  • Dispatches only the opaque job ID to the dedicated account-deletion queue; the handler resolves the user server-side and drops unknown, ambiguous, terminal, and unsupported legacy payloads before any mutation.
  • Adds reconciliation for persisted-but-undispatched intents, validates the GKE/Cloud Run deployment contract, and gives deletion tasks an account-deletion-specific OIDC audience.

Root cause and recurrence

The deletion workflow previously relied on inline execution as a reachable deployment mode and accepted a payload that could identify a user directly. A crash or configuration drift between the delete request and its side effects could therefore leave a deletion incomplete without a durable, safely replayable dispatch contract.

This follows the same dispatch/reliability failure class addressed in #5088, #6750, #7640, #8405, #9117, and #9632. The durable guard is now the persisted wipe-job identity plus production-only Cloud Tasks configuration validation, queue payload minimization, dedicated OIDC audience verification, and reconciliation through the same dispatcher.

Verification

  • cd backend && ENCRYPTION_SECRET=local-test-secret BACKEND_PYTEST_WORKERS=1 bash test.sh — passed all 603 isolated unit-test files.
  • cd backend && PATH="/tmp/omi-predeploy-9760/bin:$PATH" bash scripts/pre-deploy-check.sh — passed (69 tests); validates dev/prod runtime and deploy contracts.
  • make preflight — passed.
  • Exercised the controlled recovery path: persisted intent -> injected enqueue crash -> reconciler dispatch -> first handler completion -> repeat delivery no-op. This is covered by test_persisted_wipe_recovers_after_enqueue_crash_and_handler_runs_once.

No live Cloud Task was dispatched because this PR does not authorize a deployment mutation.

Review

Sol review completed before opening. It identified an OIDC audience-isolation issue; the fix uses ACCOUNT_DELETION_TASKS_OIDC_AUDIENCE (defaulting only to the dedicated deletion handler URL) for both task creation and verification. A second independent Sol review after rebasing identified the deploy-order compatibility path for queued legacy UID tasks; the resolved branch accepts the former sync audience only for those legacy payloads and drops job-ID payloads before resolution or mutation.

Persist opaque wipe jobs before dispatch, require production Cloud Tasks configuration, and reconcile undispatched intents.\n\nVerification: serialized backend/test.sh (603 files), backend pre-deploy checks (69 tests), make preflight, and PR preflight.
@Git-on-my-level
Git-on-my-level force-pushed the codex/account-deletion-fail-closed branch from 26ba460 to 644730e Compare July 14, 2026 23:14
Close the OIDC audience mirror hole so new-audience tasks cannot resolve
legacy uid payloads, and cover pre-job-id reconcile backfill hermetically.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Git-on-my-level
Git-on-my-level merged commit e0dd387 into main Jul 15, 2026
22 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/account-deletion-fail-closed branch July 15, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] One PR: account deletion fails closed — mandatory Cloud Tasks dispatch, job-scoped payloads, one execution owner

1 participant