Skip to content

Conversation

ddelgrosso1
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Mar 14, 2022
@ddelgrosso1
Copy link
Contributor Author

Would one of you mind pulling this down and running it a few times? I was seeing some weirdness locally and wouldn't mind a fresh set of eyes.

@ddelgrosso1 ddelgrosso1 added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2022
}

protected async createURIAsync(): Promise<string> {
const metadata = this.metadata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to make a copy of this object? The deletes mutate the object

Suggested change
const metadata = this.metadata;
const metadata = {...this.metadata};


protected async createURIAsync(): Promise<string> {
const metadata = this.metadata;
const headers: gaxios.Headers = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of the assignments, I'm not seeing how this is used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops forgot to actually assign it. Thanks.


export async function bucketUploadResumable(bucket: Bucket) {
if (bucket.instancePreconditionOpts) {
delete bucket.instancePreconditionOpts.ifMetagenerationMatch;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a comment here - I'm not sure what happens if ifMetagenerationMatch isn't deleted

@ddelgrosso1
Copy link
Contributor Author

I think I see what the problem might be. I am constantly overwriting the same file which might be causing parallel access issues. Fixing this now.

chunkSize: CHUNK_SIZE_BYTES,
metadata: {contentLength: FILE_SIZE_BYTES},
});
deleteTestFile(filePath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if the test file is not deleted? do we delete buckets as well? (i dont recall that we do)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cleaning up the local file not the file in GCS / emulator. I suppose it is unnecessary as everything will get wiped when the environment is torn down but I figured better to just clean it up anyway.

@ddelgrosso1 ddelgrosso1 added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 14, 2022
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Apr 7, 2022
@shaffeeullah
Copy link
Contributor

will re-implement on a more up-to-date branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/nodejs-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants