dropbox-sdk-js
dropbox-sdk-js copied to clipboard
Multiple filesDownload freezes
Describe the bug Using multiple filesDownload with Promise.all() freezes.
To Reproduce
Create multiple requests of filesDownload and use Promise.all().
Expected Behavior Promises should resolve or reject. May be due rate limit but would expect a reject.
Actual Behavior Promises are never resolved or rejected.
Versions
- What version of the SDK are you using? 10.34.0
- What version of the language are you using? Node 18.12.1
- Are you using Javascript or Typescript? JavaScript
Additional context Add any other context about the problem here.
Thanks for the report. How many is "multiple" when you see this, and can you share some sample code to reproduce it?
I have the issue with ~60 requests.
try {
const files = await dbx.filesListFolder({ path: '/test' })
const requests = files.map((f) => dbx.filesDownload({ path: f.path_lower }))
const response = await Promise.all(requests)
console.log(response)
} catch (err) {
console.log(err)
}
Thanks for the additional information! I just tried this out with the same version of the Dropbox library and node itself (with the slight code modification for my test account of: const files = (await dbx.filesListFolder({ path: '/testing/many' })).result.entries.slice(0, 100)) but this issue doesn't reproduce for me for 100 files. It does successfully return all of the responses.
For reference, if any calls are rejected by a rate limit server-side, the server would respond with a 429 response. I am able to receive that (a 429 with a too_many_requests error in particular) when triggering a very large number of calls (well more than 100).
How big are the files you're trying though? I'm testing with small files, but perhaps the issue is related to the amount of file data.
The files are ~1.5 MB. Until 20 requests it goes fine, only after that the issue happens. If it is fine on your side, I will try to find out. Thanks anyway!
Thanks! I can reproduce this issue when I increase the size of the files in my attempt. I'll ask the team to investigate.