dropbox-sdk-js
dropbox-sdk-js copied to clipboard
feat: add possibility to re-launch (`filesSaveUrl`) jobs
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.
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.
Thanks for writing this up! I'm sharing this as a feature request with the team.
@greg-db I would be happy to contribute a PR for this, but as there's no API endpoint for it, I can't really do anything I'm afraid 🤔😕
@MichaelDeBoey Thanks! Yes, that's correct, we'd need to implement this on the API itself first.