Repository navigation
Reduce account deletion latency and report cleanup progress - #223
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review: APPROVEReviewed exact head No blocking correctness or security findings. The cleanup changes preserve the important safety properties: started conversation RPCs settle before the deletion fence is released; failed storage batches retain retry state; trace acknowledgments are revision-sensitive; and explicit billing, identity and cleanup errors remain visible rather than being silently retried. Optional P3: recheck the retry budget after sleeping
Independent verification
Verification limits / rolloutThe failure probes use local Workers/D1/R2 emulation, not actual production failures or latency. I did not independently run browser E2E or a full web build; the remote CI results above are separate evidence. No production account was deleted. The historical incident timing and the exact production speedup are not independently established by this review. Preserve the documented platform-before-web rollout order and perform the nonproduction deletion smoke check before relying on production behavior. |
Problem / Motivation
Deleting an account could appear stuck for nearly two minutes. Retrying during cleanup incorrectly reported an unfinished billing operation. Conversation cleanup also accumulated network waits by updating trace records and deleting private files one at a time.
What changed
Cleanup now batches revoked trace records and private-file deletions, and processes up to four conversations concurrently. Failed batches retain the records needed for retry. The same idle-conversation fixture with 40 tool calls now needs five remote write/delete requests instead of 122.
The billing gate distinguishes an active deletion from an unresolved checkout. The admin panel shows progress and retries interrupted responses against the same account ID. Explicit billing and cleanup errors remain visible. Existing boolean deletion RPCs remain compatible.
Phase timings identify where future cleanup requests wait. Historical logs cannot establish the exact storage-versus-active-work split for the original slow calls. Investigation details.
%%{init: {"themeVariables": {"signalColor": "#475569", "sequenceNumberColor": "#ffffff"}}}%% sequenceDiagram autonumber participant C as Conversation cleanup participant D as Database participant F as File storage alt Before, 40-tool-call fixture C->>D: 42 individual writes C->>F: 80 individual deletes else After C->>D: 2 trace batches and 2 summary writes C->>F: 1 batch deleting 80 files endThe database and file storage remain; batches replace serial per-record requests.
Tests
All 282 targeted backend tests and 22 web tests pass, including failed-batch recovery, late tool completions and interrupted responses. The platform build, web TypeScript check and generated-documentation check pass.
Deployment notes
Deploy the platform before the web client. No database migration is required. Production deployment and a nonproduction deletion smoke test remain pending.