alpha-wallet-ios
alpha-wallet-ios copied to clipboard
`RLMException, reason: String too big`
@hboon do you have any ideas of fixing this issue?
https://console.firebase.google.com/u/0/project/alphawallet-ios-prod/crashlytics/app/ios:com.stormbird.alphawallet/issues/087983306e9dd43e58732fcfac54a7b9?time=last-twenty-four-hours&sessionEventKey=90639cde2eb6426081d6f36049c5d468_1674795446825436627
@hboon does it means that we trying to store single string that is larger then 16mb?
Looking… Strange that it says it's a regression from v3.40 (427) and was closed. I checked the closed issues and it's not there.
@hboon does it means that we trying to store single string that is larger then 16mb?
Seems so according to https://www.mongodb.com/docs/realm-legacy/docs/swift/latest/#current-limitations
Data and String properties cannot hold data exceeding 16MB in size. To store larger amounts of data, either break it up into 16MB chunks or store it directly on the file system, storing paths to these files in the Realm. An exception will be thrown at runtime if your app attempts to store more than 16MB in a single property.
Is it possible?
it couble be good to find our that exactly is large for storing, added pr to track users selected wallet address, for later watch ing and trying to reproduce
OK
@hboon i have suggestion about this issue, what if we update our code base to save balance json as file, like we do for erc1155, and store file url in realm instead whole json string?
we also can track json strings that is greater than 16 mb, and skip such balances, but i don't think that its a good idea.
it might happen, when json contains base64 data for images, that might happen quite ofter
any suggestions?
@hboon i have suggestion about this issue, what if we update our code base to save balance json as file, like we do for erc1155, and store file url in realm instead whole json string?
@oa-s hmm. But wondering if that will end up with many loose files. Is there a Blob type? What if we convert to Data when we store JSON strings? I suppose the Realm size limitation is because of indexing performance rather than storage?
not sure, as there same limitation for String, Data types, max file size is 16 mb
But wondering if that will end up with many loose files. Is there a Blob type?
oh yes, it cold be..
not sure, as there same limitation for String, Data types, max file size is 16 mb
I see. Since we are guessing that it's images that are base64 encoded in the JSON, do you want to do a size check for them and log if it exceeds a certain size? (say 2MB?) to Firebase? Then if it crashes we ought to pick it up. Maybe log these:
- URL where we picked up the JSON from
- Contract + chain
- Token ID
?