-
Notifications
You must be signed in to change notification settings - Fork 85
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
SQLite errors not catched #698
Comments
@Atemu You have something big in one of your recipes, please look if you have a large image or sth like that in the preparation description of a recipe (this would explain the exception). I will implement a catch for SQLite errors, that is indeed still missing. |
Continuation from #652 (comment) |
We do indeed have a recipe with an image in its preparation description and the HTML is therefore little more than a huge block of base64. 3MiB of it. That should be perfectly valid though since the web UI allows you to embed images into recipe descriptions like this. |
Deleting said recipe does indeed fix the issue after clearing the app's data. |
Thanks for the info, that was helpful.
No, this is not perfectly valid. Android doesn't work like the webserver does. :) Chat with ChatGPT:
I have no control over the table structure, so you have to reduce the size of your images. Generally it is not the best practice of the grocy server to store images in the text, but I understand its developer because other ways would be harder to implement. |
1. Is not an option since images can have arbitrary sizes and current standards will put most images past the 2M mark. Related question: Why does grocy-android need to store recipes locally at all? I could understand keeping recipes cached after loading them once to speed up access the next time but why do they need to be fetched and persisted unconditionally? Also, it seems ChatGPT is being confidently incorrect (as it does); CursorWindow size can be increased on newer API levels: https://medium.com/androiddevelopers/large-database-queries-on-android-cb043ae626e8 (bottom) |
Just wanted to add that here for completeness: Recipe pictures (and product pictures, equipment files and Userfield-files) are not stored in the database, but on disk in That images (and much more) are also possible to be used in any WYSIWYG editor (like for the recipe preparation text) is a feature of the used editor component Summernote. By default all embedded files are converted to "BASE64 data URIs" which can lead to very much text data at the end. That's not a general problem for SQLite (which grocy also uses server-side). Theoretically this could be changed (doc ref) (related to the web-frontend) and if that's a big problem here, I can have a look (shouldn't be too much todo, but don't know if that helps at the end when adding images from within grocy-android). |
Going back to the title of this issue: The app still shows tons of ambiguous network errors when adding a existing or a conflicting conversion or barcode. Does this issue cover that? If not would it be handy to make a list somewhere with all vague errors that aren't handled/shown properly yet to avoid separate issues, put them here as I come across them or do you guess prefer one new issue per error. |
@VNRARA that's a different topic. I'd appreciate you open a separate issue on that. |
@berrnd Thanks for your comment! For now it seems possible to simply increase the limit in our app. So it is not necessary to make things more complex with Summernote (I'm currently using Summernote too in our app). :)
We want the possibility in our app to view pages like lists also while being offline. I think there is no difference between caching and storing.
Yes, you're right. I've added some lines which extend the limit to 10 MB (I don't know how much impact on speed this has but I would not make it too large). Generally, error catching and details view of errors will be strongly improved in the upcoming release. If embedded pictures still exceed the limit in summary of 10 MB, an error while loading will be displayed. |
No description provided.
The text was updated successfully, but these errors were encountered: