Closed skidder closed 6 months ago
👋 Hey @skidder! Taking a peep at the PR ASAP, but broadly this ask makes sense to me.
@skidder you should be good to go! https://www.npmjs.com/package/@mux/upchunk/v/3.3.1 We can re-open/create a new issue if there are any problems.
Hello Mux Team! 👋
I've encountered an issue with
upchunk
's handling of resumable chunked uploads to Google Cloud Storage (GCS). Specifically, the library does not appear to process theRange
header in HTTP 308 responses correctly, potentially leading to incomplete uploads despite successful transmission of all data chunks.Current Behavior:
308 Resume Incomplete
. This response includes aRange
header, as specified in the GCS documentation.upchunk
library currently does not evaluate theRange
header in these 308 responses. Consequently, it might continue transmitting the full range of bytes without recognizing that the upload has not been completed successfully on the server's end.Expected Behavior:
Range
header of each 308 response to accurately determine the starting point for each successive chunk. Alternatively, chunks that were not fully received could be sent again in their entirety.Suggested Fix:
Range
header in 308 responses to adjust the starting byte position for subsequent chunks, or use the existing retry logic to resend any chunks that were not fully received.I believe that fixing these issues should improve the reliability of chunked uploads to GCS, or any other service that makes use of the response
Range
header. I'm happy to submit a PR or collab on a solution!Thanks!