-
Notifications
You must be signed in to change notification settings - Fork 576
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
fix(node): deepCopy not working for large Buffers #909
Merged
PeterRao
merged 1 commit into
ali-sdk:develop
from
aloisklink:fix-deep-copy-buffer-error
Dec 29, 2020
Merged
fix(node): deepCopy not working for large Buffers #909
PeterRao
merged 1 commit into
ali-sdk:develop
from
aloisklink:fix-deep-copy-buffer-error
Dec 29, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deepCopy does not work when copying an object with a large Buffer (see test case). This causes issues when using multipartUpload with the `checkpoint` option: e.g. ```js const file = Buffer.alloc(Math.pow(2, 30) - 1); // throws RangeError in utils/deepCopy multipartUpload("name", file, {checkpoint: {file, ...}}); ```
PeterRao
added a commit
that referenced
this pull request
Jan 6, 2021
* feat: support non-english http header (#842) * feat: support non-english http header * test: Add test cases for non-English request header information * feat: add headerEncoding option * feat: add encoder types * fix: remove object spread syntax Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> * fix(browser): checkpoint.file (#795) * merge branch master into develop * feat: inventory (#860) * feat: worm (#857) * feat: auto set stsConfig when sts expires (#856) * feat: auto set stsConfig when sts expires * test: add auto set sts test case * fix: host err which old image client request (#869) * fix: use put insteadof putStream when calling multipartUpload to process small file in browser (#890) * fix(browser):setTimeout has minimum time interval when tab is inactive (#887) * fix: replace process for browser * fix: use browserify options to replace process.js (#886) Co-authored-by: beajer <919060679@qq.com> * fix: merge conflict #726 (#892) * fix: merge conflict * test: ResponseTimeoutError * fix: cannot use ali-oss in webworker (#823) * feat: retry when net err or timeout (#876) * feat: retry when net err or timeout * test: should not retry when params.stream is not readable * test: retry in browser Co-authored-by: beajer <919060679@qq.com> * fix: getBucketVersions should use NextKeyMarker property (#896) * fix: getBucketVersions should use NextKeyMarker property * docs: getBucketVersions should use NextKeyMarker property * docs: Compatible wrong property * Fix multipart upload (#895) * fix: multipartUpload zancun * fix: test case * test: multipartUploadStreams * test: cov * fix: error method * fix: test and destory(err) when cancel Co-authored-by: weiyie <912881342@qq.com> * feat: listObjectsV2 (#888) * feat: listObjectsV2 * style: trailingComma none * fix: check region and endpoint for ssrf (#874) * fix: check region and endpoint for ssrf * fix: retry in browser Co-authored-by: beajer <919060679@qq.com> * use shime/url replace node-url to fix split regex bug * fix: browser test and listV2 docs (#901) * chore(release): 6.12.0 * chore: build 6.12.0 * fix: the continuation-token params in listV2 (#906) * fix: the continuation-token params in listV2 * docs: update headers.Expires * docs: revise `start-after` in listV2 (#907) * fix: should use encodeURIComponent insteadof encodeURI in copy api (#914) * fix: use lowercase header when calculating signatures (#910) * fix: use lowercase header when calculating signatures * fix: should throw error when neither bucket nor cname; docs; * fix(node): deepCopy not working for large Buffers (#909) deepCopy does not work when copying an object with a large Buffer (see test case). This causes issues when using multipartUpload with the `checkpoint` option: e.g. ```js const file = Buffer.alloc(Math.pow(2, 30) - 1); // throws RangeError in utils/deepCopy multipartUpload("name", file, {checkpoint: {file, ...}}); ``` * feat: prevent caching for the get api (#916) * feat: prevent caching for the get api * fix: support responseCacheControl for browser `get` * fix: unnecessary query parameters * fix: test case because Image Process updated compression algorithm * fix: test case of buffer replication in Nodejs8 * fix: remove test.only * fix: do not copy buffer in completeMultipartUpload (#915) * fix: do not copy buffer in completeMultipartUpload * fix: test case because Image Process updated compression algorithm * fix: test case of buffer replication in Nodejs8 * fix: remove test.only * fix: codecov * fix: merge conflict from master Co-authored-by: beajer <919060679@qq.com> Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> Co-authored-by: 冷若霜寒 <912881342@qq.com> Co-authored-by: Alois Klink <alois.klink@gmail.com>
PeterRao
added a commit
that referenced
this pull request
Jan 11, 2021
* chore: mege develop (#917) * feat: support non-english http header (#842) * feat: support non-english http header * test: Add test cases for non-English request header information * feat: add headerEncoding option * feat: add encoder types * fix: remove object spread syntax Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> * fix(browser): checkpoint.file (#795) * merge branch master into develop * feat: inventory (#860) * feat: worm (#857) * feat: auto set stsConfig when sts expires (#856) * feat: auto set stsConfig when sts expires * test: add auto set sts test case * fix: host err which old image client request (#869) * fix: use put insteadof putStream when calling multipartUpload to process small file in browser (#890) * fix(browser):setTimeout has minimum time interval when tab is inactive (#887) * fix: replace process for browser * fix: use browserify options to replace process.js (#886) Co-authored-by: beajer <919060679@qq.com> * fix: merge conflict #726 (#892) * fix: merge conflict * test: ResponseTimeoutError * fix: cannot use ali-oss in webworker (#823) * feat: retry when net err or timeout (#876) * feat: retry when net err or timeout * test: should not retry when params.stream is not readable * test: retry in browser Co-authored-by: beajer <919060679@qq.com> * fix: getBucketVersions should use NextKeyMarker property (#896) * fix: getBucketVersions should use NextKeyMarker property * docs: getBucketVersions should use NextKeyMarker property * docs: Compatible wrong property * Fix multipart upload (#895) * fix: multipartUpload zancun * fix: test case * test: multipartUploadStreams * test: cov * fix: error method * fix: test and destory(err) when cancel Co-authored-by: weiyie <912881342@qq.com> * feat: listObjectsV2 (#888) * feat: listObjectsV2 * style: trailingComma none * fix: check region and endpoint for ssrf (#874) * fix: check region and endpoint for ssrf * fix: retry in browser Co-authored-by: beajer <919060679@qq.com> * use shime/url replace node-url to fix split regex bug * fix: browser test and listV2 docs (#901) * chore(release): 6.12.0 * chore: build 6.12.0 * fix: the continuation-token params in listV2 (#906) * fix: the continuation-token params in listV2 * docs: update headers.Expires * docs: revise `start-after` in listV2 (#907) * fix: should use encodeURIComponent insteadof encodeURI in copy api (#914) * fix: use lowercase header when calculating signatures (#910) * fix: use lowercase header when calculating signatures * fix: should throw error when neither bucket nor cname; docs; * fix(node): deepCopy not working for large Buffers (#909) deepCopy does not work when copying an object with a large Buffer (see test case). This causes issues when using multipartUpload with the `checkpoint` option: e.g. ```js const file = Buffer.alloc(Math.pow(2, 30) - 1); // throws RangeError in utils/deepCopy multipartUpload("name", file, {checkpoint: {file, ...}}); ``` * feat: prevent caching for the get api (#916) * feat: prevent caching for the get api * fix: support responseCacheControl for browser `get` * fix: unnecessary query parameters * fix: test case because Image Process updated compression algorithm * fix: test case of buffer replication in Nodejs8 * fix: remove test.only * fix: do not copy buffer in completeMultipartUpload (#915) * fix: do not copy buffer in completeMultipartUpload * fix: test case because Image Process updated compression algorithm * fix: test case of buffer replication in Nodejs8 * fix: remove test.only * fix: codecov * fix: merge conflict from master Co-authored-by: beajer <919060679@qq.com> Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> Co-authored-by: 冷若霜寒 <912881342@qq.com> Co-authored-by: Alois Klink <alois.klink@gmail.com> * chrome: build * fix: responseCacheControl in Node.js (#919) * fix: responseCacheControl in Node.js * fix: code specification * chore(release): 6.13.1 * fix: failed browser test case Co-authored-by: 饶培泽 <peizerao@gmail.com> Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> Co-authored-by: 冷若霜寒 <912881342@qq.com> Co-authored-by: Alois Klink <alois.klink@gmail.com>
PeterRao
added a commit
that referenced
this pull request
Jan 21, 2021
* chore: mege develop (#917) * feat: support non-english http header (#842) * feat: support non-english http header * test: Add test cases for non-English request header information * feat: add headerEncoding option * feat: add encoder types * fix: remove object spread syntax Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> * fix(browser): checkpoint.file (#795) * merge branch master into develop * feat: inventory (#860) * feat: worm (#857) * feat: auto set stsConfig when sts expires (#856) * feat: auto set stsConfig when sts expires * test: add auto set sts test case * fix: host err which old image client request (#869) * fix: use put insteadof putStream when calling multipartUpload to process small file in browser (#890) * fix(browser):setTimeout has minimum time interval when tab is inactive (#887) * fix: replace process for browser * fix: use browserify options to replace process.js (#886) Co-authored-by: beajer <919060679@qq.com> * fix: merge conflict #726 (#892) * fix: merge conflict * test: ResponseTimeoutError * fix: cannot use ali-oss in webworker (#823) * feat: retry when net err or timeout (#876) * feat: retry when net err or timeout * test: should not retry when params.stream is not readable * test: retry in browser Co-authored-by: beajer <919060679@qq.com> * fix: getBucketVersions should use NextKeyMarker property (#896) * fix: getBucketVersions should use NextKeyMarker property * docs: getBucketVersions should use NextKeyMarker property * docs: Compatible wrong property * Fix multipart upload (#895) * fix: multipartUpload zancun * fix: test case * test: multipartUploadStreams * test: cov * fix: error method * fix: test and destory(err) when cancel Co-authored-by: weiyie <912881342@qq.com> * feat: listObjectsV2 (#888) * feat: listObjectsV2 * style: trailingComma none * fix: check region and endpoint for ssrf (#874) * fix: check region and endpoint for ssrf * fix: retry in browser Co-authored-by: beajer <919060679@qq.com> * use shime/url replace node-url to fix split regex bug * fix: browser test and listV2 docs (#901) * chore(release): 6.12.0 * chore: build 6.12.0 * fix: the continuation-token params in listV2 (#906) * fix: the continuation-token params in listV2 * docs: update headers.Expires * docs: revise `start-after` in listV2 (#907) * fix: should use encodeURIComponent insteadof encodeURI in copy api (#914) * fix: use lowercase header when calculating signatures (#910) * fix: use lowercase header when calculating signatures * fix: should throw error when neither bucket nor cname; docs; * fix(node): deepCopy not working for large Buffers (#909) deepCopy does not work when copying an object with a large Buffer (see test case). This causes issues when using multipartUpload with the `checkpoint` option: e.g. ```js const file = Buffer.alloc(Math.pow(2, 30) - 1); // throws RangeError in utils/deepCopy multipartUpload("name", file, {checkpoint: {file, ...}}); ``` * feat: prevent caching for the get api (#916) * feat: prevent caching for the get api * fix: support responseCacheControl for browser `get` * fix: unnecessary query parameters * fix: test case because Image Process updated compression algorithm * fix: test case of buffer replication in Nodejs8 * fix: remove test.only * fix: do not copy buffer in completeMultipartUpload (#915) * fix: do not copy buffer in completeMultipartUpload * fix: test case because Image Process updated compression algorithm * fix: test case of buffer replication in Nodejs8 * fix: remove test.only * fix: codecov * fix: merge conflict from master Co-authored-by: beajer <919060679@qq.com> Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> Co-authored-by: 冷若霜寒 <912881342@qq.com> Co-authored-by: Alois Klink <alois.klink@gmail.com> * chrome: build * fix: responseCacheControl in Node.js (#919) * fix: responseCacheControl in Node.js * fix: code specification * chore(release): 6.13.1 * fix: failed browser test case Co-authored-by: 饶培泽 <peizerao@gmail.com> Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> Co-authored-by: 冷若霜寒 <912881342@qq.com> Co-authored-by: Alois Klink <alois.klink@gmail.com> Co-authored-by: beajer <919060679@qq.com> Co-authored-by: biejia <wb-bj559483@alibaba-inc.com> Co-authored-by: 冷若霜寒 <912881342@qq.com> Co-authored-by: Alois Klink <alois.klink@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
deepCopy()
does not work when copying an object with a large Buffer (see test case).This causes issues when using
multipartUpload()
whenfile
is a very bigBuffer
(~1GB) and with thecheckpoint
option, since in completeMultipartUpload wedeepCopy
all the options.Example:
Copying all
Buffer
indeepCopy()
usingBuffer.from
seems to fix this issue.