-
Notifications
You must be signed in to change notification settings - Fork 124
Description
This might be a bit of an edge case, but when a task is cancelled by id (client.cancel(id:)), SchedulerDelegate.onError will continue to schedule the task, causing it to increment errorCount until it reaches the retryCount. As a result, on the next app start, for example, calling client.start() does not resume the canceled upload. The only way to resume the upload is to access client.getStoredUploads and resume them individually. This behavior differs from client.stopAndCancelAll, which causes onError to return early.
In lieu of a pause method, I would expect cancel(id), without removing the cache, to support resuming the stored upload via client.start.
I suspect there might need to be an additional check in onError that checks task.isCanceled or task.didCancel that skips metaData.errorCount += 1 and perhaps immediately calls delegate.uploadFailed(id: metaData.id, error: error, context: metaData.context, client: self)