Skip to main content

FILE_STATES

@forge/monorepo


@forge/monorepo / backend/src / FILE_STATES

Variable: FILE_STATES

const FILE_STATES: readonly ["pending", "stored", "deleting", "deleted"]

Defined in: backend/src/persistence/index.ts:1107

Where a file is in its lifecycle.

pending exists because an upload is two writes — metadata, then bytes — and the window between them is real. A file stuck in pending is metadata with no bytes, which is one of the two orphan directions reconciliation looks for.

deleting is the same window in reverse: the metadata is gone from the user's view and the bytes are not yet gone from storage. Deleting them in one transaction is not available — object storage does not join a database transaction — so the intermediate state is named rather than pretended away.