Skip to content

Upload confirm: verify object presence + size against real storage #346

Description

@codebestia

POST /uploads/:fileId/confirm only checks file ownership and current status before flipping status: 'ready'. It never calls the object store to verify the object actually exists at storageKey or matches the declared size. A file can be marked "ready" and referenced in messages that was never actually uploaded, or that doesn't match what the client claimed.

Acceptance criteria:

  • The confirm handler calls the object store (a HeadObjectCommand-equivalent method, added to lib/objectStore.ts if not already present) to verify the object exists at storageKey
  • The verified object size is compared against files.size; a mismatch is rejected rather than silently accepted
  • Verification failure returns a clear error distinguishing "object not found" from "size mismatch"
  • Works against both the local-disk dev object store and real S3 in production

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions