-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resume an incomplete upload #2162
Comments
Hey @MarkMurphy, which version of the library are you running?
We support this use case. |
v6.9.4
Ok great, happy to provide any information you need to figure this out. I'm able run a debugger during a request so I can inspect anything you want. There's a couple of places in the library code that seem like they may be relevant here. All are in the body of the nodejs-storage/src/resumable-upload.ts Lines 654 to 664 in 0501127
I think this block of logic is assuming a different scenario than the one we're in. Like needing to resend a chunk of data that failed to persist between the server and GCS for example. This ends up skipping over data the client sent by Maybe I need to use Here's an example repo with the basic code that demonstrates my current situation: |
Hey @MarkMurphy, I believe the culprit to the error is the Lines 1876 to 1885 in 0501127
Lines 1913 to 1918 in 0501127
I will look into this further in the coming days (likely tomorrow). In the meantime, feel free to try setting |
@danielbankhead Thanks, passing |
@MarkMurphy My mistake - I misunderstood the original issue. I'll work on adding this functionality shortly. |
Hi @danielbankhead, is there a update in regards to this request? I ended up running into the same thing as @MarkMurphy |
Hey @jthomasprogrammer, I’m planning to add this functionality this quarter or early next quarter |
Gotcha, thanks @danielbankhead! |
I have a node server/api that sits in front of cloud storage. It authenticates the user and requires some additional metadata before streaming the upload into cloud storage.
I'm trying abstract away and hide the fact that we're using GCS from our clients/consumers. I'm therefore building an api that mirrors the resumable upload api and that will allow clients to chunk/resume an interrupted file upload.
Please correct me if I'm wrong but this client library doesn't seem to accommodate this use case.
A client first sends a post request to my api to initiate a resumable upload e.g.
POST /files
The server then starts a resumable upload and places an object in the bucket. We store the session URI in our database for later retrieval. We then respond with the an upload id that we generate.
A client may then resume an upload via
PATCH /files/{id}
with e.g.Content-Range: bytes 456-987/1234
but there's no way for me to resume an already started resumable upload using the information in that header given how the storage library is currently written.Some example code:
Looking at the internals it seems like the behaviour is mainly determined by
startUploading
in resumable-uploads.tsThe text was updated successfully, but these errors were encountered: