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)
This might be a bit of an edge case, but when a task is cancelled by id (
client.cancel(id:)),SchedulerDelegate.onErrorwill continue to schedule the task, causing it to incrementerrorCountuntil it reaches theretryCount. As a result, on the next app start, for example, callingclient.start()does not resume the canceled upload. The only way to resume the upload is to accessclient.getStoredUploadsand resume them individually. This behavior differs fromclient.stopAndCancelAll, which causesonErrorto return early.In lieu of a
pausemethod, I would expectcancel(id), without removing the cache, to support resuming the stored upload viaclient.start.I suspect there might need to be an additional check in
onErrorthat checkstask.isCanceledortask.didCancelthat skipsmetaData.errorCount += 1and perhaps immediately callsdelegate.uploadFailed(id: metaData.id, error: error, context: metaData.context, client: self)