-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Error when trying to import big file #465
Comments
Thanks for your bug report! It is possible for the API I use to specify MIME file type filters, though the problem is that a json file may be an Even if I manage to limit it to json only files it would still crash for a large json file, and as far as I know there's no way of seeing how large a data associated with an URI is before it is too late (OOM error). |
On my phone, a 22MB APK just gives "something went wrong," but an 88MB video crashes the app.On Mar 17, 2021 11:27, Patrick Goldinger ***@***.***> wrote:
Thanks for your bug report! It is possible for the API I use to specify MIME file type filters, though the problem is that a json file may be an application/json, text/plain or even something else, depending on where the json file was created. Thus I just set it to */* and rely on the theme parser to crash so I can catch that and display the "Something is wrong" snackbar.
Even if I manage to limit it to json only files it would still crash for a large json file, and as far as I know there's no way of seeing how large a data associated with an URI is before it is too late (OOM error).
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
This has something to to with the JVM max heap size, and 22 MB is doable but not an 88MB file, definitely not if you have a Flictionary loaded at that time. P.S. When replying to comments via email, make sure to add one or two additional newlines at the end of your text (but before the "On Mar 17, 2021 1..." line) to prevent the previous message to be included in your comment visibly. This helps keeping the discussion more tidy :) |
Above PR fixes the import theme crash for big files by limiting the maximum file size for themes to 512kB (a theme on average has ~2kB). Will be included in the next beta release today. |
Short description
The theme import lets you select any file and when selecting a big (non-JSON) file it crashes. There should probably be a filter for JSON files and an error dialog that tells you when the selected file is not a valid theme JSON.
Edit: I see there already is an error snackbar when it fails to parse the JSON so this is not related to the file type.
Nevertheless I'm not sure if such a filter is even possible with the API you're using
Steps to reproduce
Environment information
The text was updated successfully, but these errors were encountered: