dropbox / dropbox/dropbox-sdk-js
feat: add possibility to re-launch (`filesSaveUrl`) jobs
- Dominant language
- JavaScript
- Stars
- 970
- Forks
- 353
- Avg merge
- 9h 3m
- Merged PRs (30d)
- 2
Description
## Why is this feature valuable to you? Does it solve a problem you're having?
I'm currently uploading some files to Dropbox using the `filesSaveUrl` method.
It seems like the the `filesSaveUrl` method always launches an async job, so the return type of these requests are all of type `LaunchResultBaseAsyncJobId`.
There's currently no way on re-launching jobs.
So if a job failed, I need to do a new `filesSaveUrl` call with the exact same `path` & `url`.
This means that I somehow have to persist `AsyncJobId`'s together with their `path` & `url`, call `filesSaveUrlCheckJobStatus` to check whether the job failed and if it did, call `filesSaveUrl` again with the persisted `path` & `url`.
## Describe the solution you'd like
I'd like to propose a new `relaunchFilesSaveUrlJob` that will re-launch the given job with it's associated `path` & `url`.
```js
const dropbox = new Dropbox({ accessToken: process.env.DROPBOX_TOKEN });
dropbox.relaunchFilesSaveUrlJob({ async_job_id });
```
## Describe alternatives you've considered
Persist all `AsyncJobId`'s together with their `path` & `url`, call `filesSaveUrlCheckJobStatus` to check whether the job failed and if it did, call `filesSaveUrl` again with the persisted `path` & `url`.
Having a way to request for all (`filesSaveUrl`) jobs (preferred with the ability to filter out only the failed ones) like described in #721 would already make all these `filesSaveUrlCheckJobStatus` calls unnecessary, but I would still have to call `filesSaveUrl` again with the persisted `path` & `url` for all failed jobs.
Contributor guide
Assessment
This issue has not been assessed yet.