-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Can't download large files #266
Comments
So all the posts I can find about |
The following error in the console appears after the timeout (sorry, I should have included it in my earlier reply):
I will try using a different browser and report Edit: same thing using Chrome, it times out. Must be something wrong with my set up. |
Regarding "https://github.com/zurdi15/romm/blob/master/frontend/src/services/download.js" is it necessary to do this part?
Can't be just send the file right away without making it a blob and use "saveAs" function? Can't we just in some way return the file? I'm not an expert at all on managing files in JavaScript. But I also think this part should be a part of backend and listen for progress from backend and then when file is ready (if multiple files, it may take some time, otherwise just send it right away). I have no idea if my idea is something that is better (or work) but just wanted to try help improving download part |
@VermiumSifell You're not far off; we can easily handle downloading single-file roms, or ones where the parts are already zipped. The issue lies with multi-file ROMs, since they'd still require some form of on-the-fly compression. |
Alright I've got something working for both single file and multi-file download https://github.com/GAntoine/romm/pull/1 It's based off my pagination PR, so that'll need to go in first before this can get merged. cc @zurdi15 |
Cool, btw cant we just send the files individually? |
We can but then we go back to the original issue, which is downloading using |
Can we change from using |
If you can think of another way to fetch multiple files without a direct-download link I'm all ears! |
I Just saw it. There are some things I want to fix from the current PR but after that I agree on changing the download feature to the backend, but I am a little bit noob with this here, so I am all ears too! |
By all means feel free to modify it, or comment with suggestions of things we can improve (on either of them). |
Altough, why not use a direct-link? Is it bad in some way? Since we do a "GET" request we can make sure it is not executed, and therefor get all files individually which should improve performance of downloads, aswell as showing progress for user a lot better. Maybe we can implement a API endpoint with ratelimits to the files? And stream the file to the user instead? |
Btw, I'm currently trying to rewrite whole backend over to NodeJS, with async/await and TypeScript. I hope I can make a PR of it later, otherwise I likk just make it as a fork of romm :) |
Wow dude you are fast. Sorry for the late response, I am sadly out of time right now to work too much on this, and didn't think too much about this NodeJS refactor of the backend. I am not an expert in NodeJS but I don't want RomM to be so fragmented this early in the development having two different backends or having a fork, so If @gantoine agree with this (as he is the main contributor other than me) we can discuss to having the full backend replacement in the main fork. What is the advantage of doing it in NodeJS against doing it with python fastapi? |
So I've worked with both Python/Fast and Node, and I find both to be perfectly capable frameworks, especially at the scale of a project like this one. Type safety is useful even on the backend, but we don't need to switch to a Node to reap those benefits (python > 3.5 has built-in typing). @zurdi15 Are you familiar/have you worked with with Node (or other JS-on-the-backend)? @VermiumSifell What's your motivation for this change? And if we do decide to make the switch at some point, we should consider Node alternatives like Deno or Bun. |
Mostly because I know of NodeJS a lot more, and find TypeScript amazing, I think of keeping this as a fork of romm, my motivation is to improve the download mechanism and I wanted to rewrite it to NodeJS too. So just something I prefer :P |
Yeah that's totally understandable, we like to work with what we know. 😄 That being said, unless we can come up with quantifiable benefits to migrating off FastAPI/Python, IMO our time would be better spend improving the current codebase. Node and Python are about equal in performance, have a lot of developers who know the languages/frameworks, support async/concurrency, and support typing. While your contributions to this project would be greatly appreciated, you're always welcome to fork and maintain a version written in Node. If you happen to have time on your hands, and your fork outpaces this project in terms of functionality over the next weeks/months, we should absolutely revisit the idea of migrating over. Oh and please let me know when your rewrite is available, I'd love to take a look through the code! |
RomM version
1.8.4
Describe the bug
downloading big ROM (2GB+) doesn't work. small ROM (20MB) download fine
To Reproduce
Steps to reproduce the behavior:
Expected behavior
ROM should start downloading, just like when you download a smaller ROM
Additional context
docker logs -f romm doesn't show any error
The text was updated successfully, but these errors were encountered: