I have faced with a strange case. I have an app that has list of items and each of them contain small image (~50 kb). When we import a data, we add these items into realm and expect them to be synced, but I got an error about limitation: “Error. could not decode next message: error reading body: failed to read: read limited at 16777217 bytes”
What is the correct workaround for a such situation?
Maybe realm is not good for storing any kind of data, that differ from string, int, double and other simple data?
Are you importing a lot of images in a single transaction? If that’s the case, then you might want to try to batch the inserts so that every batch is smaller than 16 mb - e.g. if your images are on average 50 kb, you could try inserting them in batches of 100 objects for roughly ~5mb/batch.
The issue is that the smallest unit Realm operates with is a transaction - while a single transaction may be uploaded in multiple chunks, it can either be applied in its entirety or not at all. I’ll follow up with our sync server team to see if the behavior you’re observing is expected and if there’s any immediate improvements we can make, but splitting the transaction on your end will verify if that’s indeed the culprit and allow you proceed until we have a fix in place.