FM-021 Time, State, and API Lifecycle

File Upload and Downstream Processing Failures

The API returns success while the file never reaches its final destination — storage, scanning, or processing failed silently.

Failure explanation

An upload endpoint accepts bytes but the complete file workflow fails. The object may not be durably stored, may be truncated, may fail checksum validation, or may never reach scanning, archival, or downstream processing. A 200 or 202 response can be misleading if the contract does not distinguish receipt from completed processing.

Example

The API returns 201 Created after writing upload metadata to the database, but the object-store write fails. The record points to a file that does not exist.

How to test

  • Exercise multipart boundaries, large and empty files, interrupted transfers, duplicate uploads, and checksum mismatches.
  • Inject object-store and downstream processor failures.
  • Check consistency between metadata and stored objects.
  • Validate status transitions for asynchronous scanning or archival.

Expected behavior

The response clearly defines whether the file was received, durably stored, or fully processed. Failed stages are observable and recoverable without falsely reporting completion.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.