Skip to content

Fix cleanup orphans, private manageUrl, and related production risks - #1

Draft
leoisadev1 wants to merge 3 commits into
mainfrom
cursor/bc-1cbadbb1-4cb2-490f-96dd-11e3b3c8e393-e4f3
Draft

Fix cleanup orphans, private manageUrl, and related production risks#1
leoisadev1 wants to merge 3 commits into
mainfrom
cursor/bc-1cbadbb1-4cb2-490f-96dd-11e3b3c8e393-e4f3

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Summary

Implements the production-risk audit fixes for AgentDrop:

  • Retry-safe purge/cleanup — R2 ledger/image rows are only removed after a successful delete; sites drain in bounded batches with self-scheduling and backoff so failed deletes can retry without forgetting keys.
  • Private pagesgetBySlugForManager lets manageUrl?t= and /{slug}?t= work for edit-token holders (matches the skill).
  • Write-path compensate — deploy/update/image metadata failures delete the just-stored R2 blob; deploy no longer maps every error to a fake 409.
  • Claim guard — cannot steal an already-owned site.
  • OAuth — rate limits on register/token; codes indexed by expiresAt; grant cleanup self-schedules when saturated.
  • Hygiene — bounded listMine / imageCount, healthCheck args, remove tracked .wrangler state + empty nonexistent, root .gitignore ignores .wrangler/.

Test plan

  • bun run packages/backend/scripts/verify-audit-fixes.ts — contract checks passed
  • bunx tsc -p packages/backend/convex/tsconfig.json --noEmit
  • bunx tsc --noEmit in apps/web (after regenerating routeTree.gen.ts locally)
  • Against a Convex dev deployment: expire sites / force R2 failure → ledger retained → retry succeeds
  • Deploy private site → open manageUrl logged out → manage UI works
  • Claim as A, claim with token as B → rejected
  • Burst POST /oauth/register → 429

Notes

Email verification remains off (requireEmailVerification: false) as a documented follow-up — enabling it needs an email provider.

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 16, 2026 18:43
Purge and expiry no longer drop ledger rows when R2 delete fails; sites
drain in bounded batches with self-scheduling and backoff. Deploy/update/
image metadata failures compensate by deleting the just-stored blob, and
OAuth register/token plus grant cleanup are rate-limited and indexed.
Claim cannot steal an already-owned site; listMine and imageCount stay
bounded.

Co-authored-by: Leo <leoisadev1@users.noreply.github.com>
manageUrl and /:slug?t= use getBySlugForManager so private deploys match
the skill's promise. Also ignore local .wrangler state in the root
gitignore.

Co-authored-by: Leo <leoisadev1@users.noreply.github.com>
Static checks for retry-safe purge, write-path compensate, claim guard,
OAuth limits, and bounded queries, plus a few runtime helper smoke tests.

Co-authored-by: Leo <leoisadev1@users.noreply.github.com>
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-drop Ready Ready Preview Aug 16, 2026 6:44pm

Request Review

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.

2 participants