Comments (3)
Hi, thanks for reaching out! Quick reaction before I head off to work: I do think the core issue is that you are reusing the ID when starting the download after closing the app, which is not "the contract" for the downloader plugin. The easiest way to address the issue therefore would be to use a new unique ID when restarting a task that was killed when the app closed. That said, i want to look into what exactly causes the issue you describe. Do you know if it behaves the same on another desktop platform (MacOS or Linux)?
from background_downloader.
Hi, I haven't been able to replicate what you're describing. I use the example app and modify the task to use the same ID (and modify the downloader a bit so it takes long for the download to complete), start the download, kill the app, start it again (with the same id) and it just completes normally.
I also don't quite understand how there can be any remnant of a task still running after you kill the app (though perhaps the isolate where the download happens keeps running after the app closes? That seems weird but possible, and would then continue to generate status updates with the same taskID). Even so, the new download should not interfere with whatever remains ongoing (and per your logs it suggests it does indeed complete normally), even if it reuses the id, as it will use a new temp file to download to (unless the Dart Random
implementation is not random and regenerates the same filename). It's possible that if there is a 'ghost isolate' from the previous app run it gets killed by the OS eventually, but that should lead to 'failed' and not 'canceled'. Is there anywhere you are issuing a cancel
command, or reset
?
The message about not being able to delete the temp file means that by the time it wanted to cancel the task (and delete the partial download stored in the temp file) the temp file was no longer there, or was in use - possibly the OS cleans it up when you kill the app?
Sorry I don't have any better answers. Please try using a different (random) id and see if it works then, or if not please post the full logs for both app runs.
from background_downloader.
Hi @eivihnd wanted to see if you've been able to solve the problem by using a unique ID? As mentioned, I wasn't able to replicate the issue so unless you can provide more details I will close this issue in a few days.
from background_downloader.
Related Issues (20)
- [Android] notification icon HOT 3
- Large attachment uploading takes a while HOT 2
- Build failure with `background_downloader` due to missing Kotlin plugin HOT 3
- Monthly issue metrics report for opened issues and prs
- Monthly issue metrics report for closed issues and prs
- Receive status update in background HOT 6
- Lack of Docs for `downloadBatch` HOT 1
- Upload tasks get randomly restarted on a slow Android device HOT 4
- Duplicate Task when uploading an image HOT 6
- Could not find org.jetbrains.kotlin:kotlin-serialization-compiler-plugin-embeddable:1.7.10. HOT 3
- Failed to open file on Android java.lang.IllegalArgumentException: Failed to find configured root that contains: HOT 4
- Android build is failing due to missing Kotlin lib HOT 1
- IOS download error HOT 6
- kotlin-serialization-compiler-plugin-embeddable:1.7.10. HOT 1
- Monthly issue metrics report for opened issues and prs
- Monthly issue metrics report for closed issues and prs
- when use FileDownloader().download() on IOS devices, it throws Exception "could not enqueue DownloadTask"
- downloadBatch can't be cancelled mid download
- ParallelDownloadTask: All Chunks Cancelled Unexpectedly HOT 5
- can't be cancelled mid download all cancel api HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from background_downloader.