funmusicplace / mirlo

An open source audio distribution and patronage platform
https://mirlo.space/
GNU General Public License v3.0
98 stars 15 forks source link

Firefox popup blocker blocks album download #644

Open graue opened 3 months ago

graue commented 3 months ago

When I tried to download the album I bought, I got this "We're generating the album! Hold on for a minute..." message:

Screenshot from 2024-04-04 23-10-13

It took several minutes, actually. Quite slow. (I hope optimizing this is on your radar.) So I switched tabs and was doing something else. When I tabbed back, that message had simply disappeared, and there was no indication of why it had disappeared. After some confusion I decided to click Download a second time and it worked.

To try to repro this and give you a more useful bug report, I tried again with a different file format and this time kept watching the tab. It turns out Firefox's popup blocker is blocking the delayed download:

Screenshot from 2024-04-04 23-11-57

Firefox's behavior makes sense to me, for what it's worth. It would be confusing to have a file download suddenly interrupt me several minutes later when doing something else.

I suggest redesigning this UI so there's only a button to click after the files are ready. Start converting the files as soon as a file format is selected, and show a spinner (better yet, progress bar with ETA) + disabled button until conversion is done.

simonv3 commented 3 months ago

Thanks for the report. I'm definitely not an optimization person, so if anyone has thoughts on how to improve this more than it already is, please feel free to pitch in.

We generate files when a user requests them, because a lot of these files take up a lot of space. I think starting the generation earlier makes sense, once the user chooses a file format (and leave the file format without a default so they have to choose something). To do the generation we do it all using Node streams, and I'm afraid that the limiting factor is probably just that we don't pay enough money for more memory / CPU (we're currently running our Background worker on a Standard Render server). The main blocker there is cost and we're currently running on a shoe string budget. Bumping to a higher server would cost $60/month extra, but feel free to pitch in for that). I'd love to improve that! It's probably possible to rewrite this to be super fast using something like Go or Rust, but that's not me :P

Anyways, I do think there are UX improvements we can make here in the mean time.