medito-app icon indicating copy to clipboard operation
medito-app copied to clipboard

Trying to download a Background Sound with no connection

Open michaelcspeed opened this issue 3 years ago • 15 comments

When you're downloading a background sound, if there is a slow connection or no connection, at the moment, an Exception is thrown but the UI doesn't respond. We should have a snackbar or something to indicate the error, and cancel the loading spinner

[branch: develop]

michaelcspeed avatar May 17 '21 15:05 michaelcspeed

mmm I think we shouldn't display the background sounds that aren't available instead?

scouech avatar May 17 '21 15:05 scouech

Relevant file: lib/widgets/player/background_sounds_sheet_widget.dart Line 182: Right now it shows the list of all background sounds and caches the list. When you click on one, it downloads the mp3.

For better offline functionality, we would need to save a list of the files that are downloaded, and only show that list if there is no connectivity.

We can check the connectivity with await (Connectivity().checkConnectivity()); It might be good to use this in conjunction with a FutureBuilder

michaelcspeed avatar May 22 '21 12:05 michaelcspeed

I'll give this issue a try!

jthure avatar May 24 '21 10:05 jthure

Awesome! Thanks @jthure ! :)

scouech avatar May 24 '21 13:05 scouech

hey @jthure, how is it going?

scouech avatar Jun 02 '21 14:06 scouech

hey @jthure, how is it going?

I was hit by a massive workload at work, so I haven't had much time to spare, but I've looked into it and have a solution in mind. I'll get a pr submitted shortly :)

jthure avatar Jun 03 '21 17:06 jthure

Hey @jthure , all good?

scouech avatar Aug 18 '21 10:08 scouech

Sorry about my radio silence. Got occupied by other stuff and didn't get chance to finish it. I'll un-assign myself for now and get back to it when get a chance if it is still available

jthure avatar Aug 18 '21 15:08 jthure

I'll take a look at this!

harshadmanglani avatar Sep 25 '21 07:09 harshadmanglani

Just to check if I've understood this correctly:

CASE 1: No connectivity as the app is opened - show the cached list of already downloaded background sounds or an empty list

CASE 2: There was connectivity when the app is opened but by the time the user starts the meditation, they lose connectivity - show the cached list of already downloaded background sounds or an empty list (same as case 1)

CASE 3: They lose connectivity while downloading a background sound (and the spinner keeps rotating as of now) - what would be the expected behavior here?

I'll start working on case 1 & 2 in the meanwhile, if there's anything there, please let me know!

harshadmanglani avatar Oct 13 '21 04:10 harshadmanglani

Awesome! Thank you @harshadmanglani ! The 3 cases are exactly right !

scouech avatar Oct 13 '21 09:10 scouech

@scouech so the spinner needs to stop rotating and a snackbar should come up for case 3 right?

harshadmanglani avatar Oct 13 '21 12:10 harshadmanglani

Yep, i think it makes sense? Might be the easiest

scouech avatar Oct 13 '21 12:10 scouech

Yes okay, understood!! Yeah, does seem like it'll be easy :)

harshadmanglani avatar Oct 13 '21 12:10 harshadmanglani

A quick update: I'm done with all 3 cases, I'm working on fixing a few bugs with the AudioService

harshadmanglani avatar Oct 21 '21 07:10 harshadmanglani

As we massively changed the app I'm closing this as it's not entirely relevant anymore

scouech avatar Aug 10 '23 14:08 scouech