Open Chralu opened 1 year ago
A solution would be to make step 2 synchronous. That way, we would be certain that Episode.downloadTaskId
is changed on time.
I see two ways of implementing that :
SembastRepository
to make read/write operations synchronous (just like Isar does).I will give this issue some thought. I have been thinking about db solutions as I feel that Anytime is starting to outgrow Sembast. Sembast is an excellent package and has made it very easy to incorporate a pure Dart data store solution, but its strengths are now starting to limit Anytime: I have to be very conscious of what data we store with Sembast being an in-memory store and with it not being cross isolate safe implementing background data fetching will be challenging. It may be that Sembast is replaced or complemented with another solution such as Isar, Objectbox or Realm. Replacing the entire DB layer is no small task.
I might be helpful on this kind of task.
a thought : Is null-safety migration prior to SGBD migration ?
Describe the bug
When requesting a download that immediately fails, UI stays stucked on the "download in progress" state.
It might happen using iOS when episode URLs are non-SSL http://. There might be other cases where download fails as soon as it starts.
To Reproduce
Analyse
mobile_download_service.dart
Starting a download sequentially :
FlutterDownloader
FlutterDownloader
task id -> persists it in sembastEpisode.downloadTaskId
DownloadService
Episode.downloadTaskId
in SembastIn the case where download immediately fails, the download status changes before step 2. is done. Then, a
download update
event arrives butDownloadService
is unable to find the matchingEpisode
in sembast. => Sembast episode is not updated =>Repository.episodeListener
is not updated =>PodcastBloc
is not updatedScreenshots
https://user-images.githubusercontent.com/375723/222785098-f3ee7f5b-48b9-4c38-a986-0cfda6ae84c6.mp4
Smartphone (please complete the following information):