Open kadnan0900 opened 3 years ago
same issue
It seems that when restarting a flutter application the first call to enqueue a new upload produces a number of UploadTaskResponses to be fired on the uploader's result.listen channel. These tasks are all marked as Enqueued in their status, but they are in fact previous Complete. I think a workaround is to call clearUploads(), but we can only really do that if all items have been marked as complete.
Out of interest, this plugin was obviously inspired by flutter_downloader which uses sqlite as their persistence mechanism for tasks. Is there any reason this was switched out in favour of a file based persistence framework for tasks?
StreamSubscription _resultSubscription;
// setState(() => _tasks = tmp); }, onError: (ex, stacktrace) { print('exception: $ex'); print('stacktrace: $stacktrace' ?? 'no stacktrace'); });