Closed Joseph82 closed 4 years ago
@Joseph82 Do you have an inner root cause, the one following the line at .Caused
?
@pilgr unfortunately I don't. It is a simple reading of an object with this structure:
data class MyClass(val data: String)
So far it only happened with 1 user.
I could assume that user changed some permissions which now prevents Paper from reading data or made some manual changes to the *.pt file. It's hard to say for sure.
Unfortunately without the additional information, it's not reasonable to keep the issue open so I'm going to close it for now.
Please add more info as soon as you know.
It seems like the cause was a Buffer underflow while reading a value from Kryo. I see there is already an open issue for that, so I will not report it.
@pilgr I am back with some extra info :)
Paper.book(DbConstants.DB_NAME).allKeys.contains(DbConstants.DEVICE_ID_KEY)
indeed returns true.Considering the first point, I think the problem could be related with the scoped storage introduced in Android 10. About using the UI thread, we will fix that for sure, but I am not sure it can be the cause of the problem.
Is Paper using external storage? Can you maybe share more info about how Paper deal with File? Thank you.
Sure, with Paper you can store data anywhere. For that, Book
instance can be created at the custom location. Please find more here https://github.com/pilgr/Paper#set-storage-location-for-book-instances
By default, the book is created in the internal app's storage which should be freely accessible by the app itself.
Thank you, @pilgr yes, I checked the source code. Do you think that reading from UI-thread can be the cause of the problem on some devices?
I am using version 2.6, and I saw that one device (with Android 10) was keep getting this error while reading an object from the db:
I am quite sure there is no problem in the model. The db was created just once and the model never changed.
Phone specs: Samsung Galaxy S10+ (beyond2q), 7680MB RAM, Android 10