Storage uploads continue via signed URLs after user account deletion

If files continue to be uploaded or recreated after a user account has been fenced or marked for deletion, this is typically due to pre-existing signed upload URLs.

Why this happens

Signed upload URLs act as standalone bearer tokens that are evaluated only at issuance. Because of this, database-level fencing or invalidating a user’s JWT does not invalidate active upload URLs.

Supabase does not provide per-user or per-object URL revocation without revoking the project’s global signing key.

How to handle account deletion with active upload URLs

To safely delete an account and prevent unexpected uploads, implement an expiry-based drain sequence:

  1. Stop issuing URLs: Immediately block your application from generating new signed upload URLs for the target account.
  2. Wait for expiration: Allow active URLs to expire according to your configured URL lifetime (typically up to 2 hours), adding a safety margin for slow in-flight single-request uploads to finish or terminate.
  3. Cancel S3 multipart uploads: If you are using the S3-compatible API, inspect and cancel any remaining incomplete uploads using ListMultipartUploads and AbortMultipartUpload.
  4. Purge objects: Delete the account’s existing storage objects and execute the final account erasure only after the drain window has elapsed.