You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constargs={ ... variousthings ...,contents: someBuffer};dbx.filesUpload(args).catch(error=>{// If it's a 429, wait a bit, then try again// ...returndbx.filesUpload(args);// BUG: Will result in an empty upload!})
To Reproduce
See the second pseudo-code example above:
construct args for a filesUpload request
make request
observe that args.contents is gone, thus setting a trap for retry logic
Expected Behavior
Calling the Dropbox API should not mutate the provided arguments.
Actual Behavior
In at least this case, the Dropbox API mutates the provided argument.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions
What version of the SDK are you using? 10.23.0
What version of the language are you using? node v18.0.0, typescript 4.5.4
Are you using Javascript or Typescript? - typescript
What platform are you using? (if applicable) - macos
I can see the bug still present in the SDK as at 6b3404d. See the first code sample, pasted above.
Describe the bug
Calling
dbx.filesUpload(args)
modifiesargs
, in that it deletesargs.contents
. From the sdksrc/dropbox.js
:dropbox-sdk-js/src/dropbox.js
Lines 133 to 146 in 6b3404d
This makes it harder to handle errors:
To Reproduce
See the second pseudo-code example above:
args
for afilesUpload
requestargs.contents
is gone, thus setting a trap for retry logicExpected Behavior
Calling the Dropbox API should not mutate the provided arguments.
Actual Behavior
In at least this case, the Dropbox API mutates the provided argument.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions
I can see the bug still present in the SDK as at 6b3404d. See the first code sample, pasted above.
Additional context
I would guess that the fix looks a bit like:
but this is not my comfort language so I'm not sure.
The text was updated successfully, but these errors were encountered: