Skip to content
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

Resuming PATCH requests override already uploaded GCS data #37

Closed
bhstahl opened this issue May 31, 2016 · 0 comments · Fixed by #183
Closed

Resuming PATCH requests override already uploaded GCS data #37

bhstahl opened this issue May 31, 2016 · 0 comments · Fixed by #183

Comments

@bhstahl
Copy link
Contributor

bhstahl commented May 31, 2016

In order to store the metadata from the POST request, a GCS object needs to be created, since the metadata isn't stored in a resumable URI. To fix that, GCSDataStore.create() pipes an empty stream to create an empty GCS object, containing the data.

If we maintain the GCS upload id, (passed back in the 'x-guploader-uploadid' header) to use the same resumable URI, the content type won't match in GCSDataStore.write(), and GCS will delete the object:

Error: The uploaded data did not match the data from the server. As a precaution, the file has been deleted. To be sure the content is the same, you should try uploading the file again

So, right now, the Upload-Offset header does not translate through to the gcloud-node package as a resume session, but rather a replacement upload to the same object.

Resuming an upload will currently replace the GCS object with the new data piped in, and override the starting bytes of the file at the resumed offset 😢 .

@bhstahl bhstahl added the bug label May 31, 2016
@bhstahl bhstahl added this to the 1.0.0 Official Release milestone May 31, 2016
bhstahl pushed a commit that referenced this issue May 31, 2016
@bhstahl bhstahl added this to On Deck in Release 1.0.0 Mar 13, 2017
@mitjap mitjap moved this from On Deck to In progress in Release 1.0.0 Jun 8, 2021
@mitjap mitjap moved this from In progress to Done in Release 1.0.0 Jun 9, 2021
Murderlon added a commit that referenced this issue Feb 1, 2022
* master: (72 commits)
  Update all dependencies
  Remove coveralls & update coverage script
  Remove .travis.yml
  Setup GitHub Actions
  Update package-lock with npm audit fix
  Bump aws-sdk from 2.761.0 to 2.814.0 (#197)
  Bump to v0.4.0
  Add metadata parsing and stringification functions
  Implement creation-with-upload extension
  Implement GET handler
  Fix issues with GCS datastore tests
  Implement resumable uploads with GCS (#37)
  Bump handlebars from 4.7.6 to 4.7.7 (#178)
  Bump lodash from 4.17.20 to 4.17.21 (#179)
  Bump url-parse from 1.4.7 to 1.5.1 (#180)
  Bump date-and-time from 0.14.1 to 0.14.2 (#175)
  Bump y18n from 4.0.0 to 4.0.1 (#176)
  Use new URL for tus demo server
  Upgrade dependencies and drop Node.js v8 support (#173)
  Bump node-fetch from 2.3.0 to 2.6.1
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

1 participant