Repository navigation
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
- Check the API's issue tracker: https://cloud.google.com/support/docs/issue-trackers
Library Name
@google-cloud/storage
A screenshot that you have tested with "Try this API".
N/A. This is a local path computation bug in the client library, not an API call.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://gist.github.com/arjunjaincs/9048774649412c2bf12fd66da1a40f96
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
- npm i @google-cloud/storage (8.4.0)
- Run the gist (file.download is stubbed, no credentials needed)
- Observe the destination passed to file.download
A clear and concise description of what the bug is, and what you expected to happen.
DownloadManyFilesOptions.prefix is documented as "A prefix to append to all of the downloaded files", but TransferManager#downloadManyFiles ignores it.
Call: downloadManyFiles([bucket.file('first.txt')], {prefix: 'out-dir'})
Expected: /out-dir/first.txt
Actual: /first.txt
The base directory is computed only from passthroughOptions.destination, so prefix has no effect. This appears to have been dropped when path containment was added in googleapis/nodejs-storage#2654.
The existing test "sets the destination correctly when provided a prefix" passes anyway: its assertions run inside the stubbed file.download, and downloadManyFiles catches errors thrown there and reports the file as skipped.
I have a fix with tests ready and will open a PR.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The public option type and docs describe prefix as prepended to downloaded file paths. It worked before path containment was introduced.
Activity