A 12 MB artifact is split into three chunks. The client uploads chunk 2 twice, loses the response to finalize, and retries. A weak API creates two artifacts or assembles corrupted data.

Define the contract

type Chunk={sessionId:string,index:number,sha256:string,size:number};

type Finalize={sessionId:string,orderedHashes:string[],artifactSha256:string};

Enter fullscreen mode