انتقل إلى المحتوى الرئيسي

Type Alias: PutResult

PutResult = { etag: string; status: "stored"; } | { identical: boolean; status: "exists"; } | { status: "stale"; }

Defined in: packages/artifact-store/src/port.ts:86

What a put did. Every outcome is an answer; a failure is an ArtifactStoreError.

  • stored: the bytes are now the object at the key. etag is the store's entity tag, quoted as served (for the stack's store, the MD5 of the body).
  • exists: only with ifNoneMatch: '*'. The key already held an object and nothing was written. identical says whether that object is byte-for-byte the bytes this call carried, which is how a retry after a lost response tells "my earlier attempt landed" from "someone else's object is there".
  • stale: only with ifMatch. The key no longer holds the object the tag names (it was replaced, or it is gone) and nothing was written. It carries nothing else on purpose: the caller's copy is out of date, so the next move is to get again and decide from what is there, and that read is also what tells a lost race from this caller's own earlier attempt having landed.