Realm v10.0.0-RC.1 Release Notes

Release Date: 2020-10-02 // over 3 years ago
  • ๐Ÿ— We no longer support Realm Cloud (legacy), but instead the new MongoDB Realm Cloud. MongoDB Realm is a serverless platform that enables developers to quickly build applications without having to set up server infrastructure. MongoDB Realm is built on top of MongoDB Atlas, automatically integrating the connection to your database.

    ๐Ÿ”จ The old Realm Cloud legacy APIs have undergone significant refactoring. The new APIs are all located in the io.realm.mongodb package with io.realm.mongodb.App as the entry point.

    ๐Ÿ’ฅ Breaking Changes

    • ๐Ÿ— From now on it is not allowed by default to run transactions with either Realm.executeTransaction() or DynamicRealm.executeTransaction() from the UI thread. Doing so will yield a RealmException. Users can override this behavior by using RealmConfiguration.Builder.allowWritesOnUiThread(true) when building a RealmConfiguration to obtain a Realm or DynamicRealm instance, though we do not recommend doing so. Instead, we recommend using executeTransactionAsync() or, alternatively, using non-UI threads when calling executeTransaction() for both Realms and DynamicRealms.

    โœจ Enhancements

    • ๐Ÿ— Users can now opt out from allowing queries to be launched from the UI thread by using RealmConfiguration.Builder.allowQueriesOnUiThread(false). A RealmException will be thrown when calling RealmQuery.findAll(), RealmQuery.findFirst(), RealmQuery.minimumDate(), RealmQuery.maximumDate(), RealmQuery.count(), RealmQuery.sum(), RealmQuery.max(), RealmQuery.min(), RealmQuery.average() and RealmQuery.averageDecimal128() from the UI thread after having used allowQueriesOnUiThread(false). Queries will be allowed from the thread from which the Realm instance was obtained as it always has been by default, although we recommend using RealmQuery.findAllAsync() or RealmQuery.findFirstAsync(), or, alternatively, using a non-UI thread to launch them.
    • 0๏ธโƒฃ BaseRealm.refresh() will throw a RealmException if it is being called from the UI thread if allowQueriesOnUiThread is set to false, though it will be allowed by default.
    • โž• Added DynamicRealm.executeTransactionAsync().
    • โž• Added Kotlin extension suspend function Realm.executeTransactionAwait() which runs transactions inside coroutines.
    • โž• Added Kotlin extension function RealmResults.toFlow() which returns a Kotlin flow, similar to our RxJava convenience method asFlowable().
    • โž• Added Kotlin extension function RealmList.toFlow() which returns a Kotlin flow, similar to our RxJava convenience method asFlowable().
    • โž• Added Kotlin extension function RealmModel.toFlow() which returns a Kotlin flow, similar to our RxJava convenience method asFlowable().

    ๐Ÿ›  Fixed

    • โšก๏ธ Using Realm.copyToRealmOrUpdate() and Realm.insertOrUpdate() did not correctly update objects if they contained lists of embedded objets. Instead of replacing the original list, list items was appended to the original list. Note, some corner cases are still not supported. See #7138 for more information. (Issue #7131, since 10.0.0-BETA.1).

    Compatibility

    • โฌ†๏ธ File format: Generates Realms with format v20. Unsynced Realms will be upgraded from Realm Java 2.0 and later. Synced Realms can only be read and upgraded if created with Realm Java 10.0.0-BETA.1.
    • ๐Ÿš€ APIs are backwards compatible with all previous release of realm-java in the 10.x.y series.
    • Realm Studio 10.0.0 and above is required to open Realms created by this version.

    Internal

    • โšก๏ธ Updated to Object Store commit: ef6736cc07a8b94d1242c522969114bb8047deef
    • โšก๏ธ Updated to Realm Sync 10.0.0-beta.14.
    • โšก๏ธ Updated to Realm Core 10.0.0-beta.9.