@@ -941,16 +941,16 @@ export class BlobManager {
941941 const localBlobRecord = this . localBlobCache . get ( localId ) ;
942942 assert ( localBlobRecord !== undefined , 0xc83 /* Pending blob must be in local cache */ ) ;
943943 assert (
944- localBlobRecord . state === "uploading" ||
945- localBlobRecord . state === "uploaded" ||
946- localBlobRecord . state === "attaching" ,
947- 0xc84 /* Pending blob must be in uploading, uploaded, or attaching state */ ,
944+ localBlobRecord . state !== "attached" ,
945+ 0xc84 /* Pending blob must not be in attached state */ ,
948946 ) ;
949- // We treat blobs in both uploaded and attaching state as just being uploaded, to distrust
950- // whether we expect to see any ack for a BlobAttach op. We just remain prepared to handle
951- // a BlobAttach op for it if we do see one after loading from pending state.
947+ // We downgrade uploading blobs to localOnly, and attaching blobs to uploaded. In the case of
948+ // uploading blobs, we don't have a way to retrieve the eventual storageId so the upload will
949+ // need to be restarted anyway. In the case of attaching blobs, we can't know whether the
950+ // BlobAttach op will eventually be ack'd. So we assume we'll need to send another op, but also
951+ // remain prepared to handle seeing the ack of the original op after loading from pending state.
952952 pendingBlobs [ localId ] =
953- localBlobRecord . state === "uploading"
953+ localBlobRecord . state === "localOnly" || localBlobRecord . state === " uploading"
954954 ? {
955955 state : "localOnly" ,
956956 blob : bufferToString ( localBlobRecord . blob , "base64" ) ,
0 commit comments