flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

Cancel paused task

Open KyriakosMilad opened this issue 2 years ago • 3 comments

When a task is paused it can't be canceled, nothing happens when I call FlutterDownloader.cancel(id);

here is my console when I pause a task:

I/WM-WorkerWrapper( 4633): Work [ id=a0a1583b-d0f5-4e63-b5b4-2fca3c0efd3e, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ] was cancelled
I/WM-WorkerWrapper( 4633): java.util.concurrent.CancellationException: Task was cancelled.
I/WM-WorkerWrapper( 4633): 	at androidx.work.impl.utils.futures.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:1184)
I/WM-WorkerWrapper( 4633): 	at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue(AbstractFuture.java:514)
I/WM-WorkerWrapper( 4633): 	at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:475)
I/WM-WorkerWrapper( 4633): 	at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:311)
I/WM-WorkerWrapper( 4633): 	at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
I/WM-WorkerWrapper( 4633): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
I/WM-WorkerWrapper( 4633): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
I/WM-WorkerWrapper( 4633): 	at java.lang.Thread.run(Thread.java:923)
D/DownloadWorker( 4633): Update notification: {notificationId: 71, title: Placeholder Video_aio_64kbps.webm, status: 6, progress: 7}
D/DownloadWorker( 4633): Download canceled

And nothing shows in the console when I try to cancel after the task was paused.

KyriakosMilad avatar Apr 27 '22 21:04 KyriakosMilad

same thing happened for me.

alexaung avatar Jun 22 '22 14:06 alexaung

image

It also is my problem

tranvanphay avatar Jul 04 '22 07:07 tranvanphay

problem when pausing it wil generate new taskId just like retry, so the previous taskId not get updated in ui screen, you need to update to the newest taskId when resume

FlawLessx avatar Jul 29 '22 17:07 FlawLessx