Skip to content

Commit

Permalink
fix: handle edge case for resuming chunk upload case where multiple c…
Browse files Browse the repository at this point in the history
…hunks have previously been uploaded.
  • Loading branch information
cjpillsbury committed Apr 29, 2024
1 parent 856459b commit 255a51d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/upchunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ export const isIncompleteChunkUploadNeedingRetry = (
}

const endByte = parseInt(range[2], 10);
return endByte !== _options.currentChunkEndByte;
// NOTE: Since the endpoint may have been used previously and uploaded multiple chunks,
// only treat as an incomplete chunk upload if the end byte from the response header is
// less than the current chunk's end byte.
return endByte < _options.currentChunkEndByte;
};

type EventName =
Expand Down

0 comments on commit 255a51d

Please sign in to comment.