dropbox / dropbox/dropbox-sdk-js
Attempts to download a >1GB files fail
- Dominant language
- JavaScript
- Stars
- 970
- Forks
- 353
- Avg merge
- 9h 3m
- Merged PRs (30d)
- 2
Description
## Steps to reproduce
- Attempt to download a large ~1GB file using the `dropbox.filesDownload()` method
## Expected Result
- File gets downloaded fine.
## Actual Result
- A V8 memory error is logged and the download fails:
## Logs
```bash
/node_modules/dropbox/src/download-request.js:27
res.on('data', function (chunk) { res.text += chunk; });
^
RangeError: Invalid string length
at IncomingMessage. node_modules/dropbox/src/download-request.js:27:27)
at emitOne (events.js:96:13)
at IncomingMessage.emit (events.js:189:7)
at readableAddChunk (_stream_readable.js:176:18)
at IncomingMessage.Readable.push (_stream_readable.js:134:10)
at HTTPParser.parserOnBody (_http_common.js:123:22)
at TLSSocket.socketOnData (_http_client.js:411:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:189:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
at TLSWrap.onread (net.js:551:20)
```
## Notes
AFAIK `RangeError: Invalid string length` is a V8 out-of-memory error. It basically complaints that a string's length is too long. Perhaps `res.on('data')` response should accumulate on a `Buffer` instead to circumvent this?
Contributor guide
Assessment
This issue has not been assessed yet.