Skip to content

Canceling a task by id continues to retry task #214

@cwalo

Description

@cwalo

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions