Realm is a mobile database: a replacement for Core Data & SQLite
SyncSession.reconnect()
while a reconnect after a non-fatal error was pending would result in an assertion failure mentioning "!m_try_again_activation_timer" if another non-fatal error was received (Core #6961).try realm.write {
realm.add(Person())
}
try await realm.syncSession?.wait(for: .upload)
Note that this should not generally be used– sync is eventually consistent and should be used as such. However, there are special cases (notably in testing) where this may be used.KeyNotFound
exception. (Core #7090, since v10.28.2)MutableSet<String>.formIntersection()
would sometimes cause a use-after-free if asked to intersect a set with itself (since v10.0.0).List<Object>
or List<AnyRealmValue>
that operated on indices that were not also added in the recovery, links to an object which had been deleted by another client while offline would be recreated by the recovering client, but the objects of these links would only have the primary key populated and all other fields would be default values. Now, instead of creating these zombie objects, the lists being recovered skip such deleted links. (Core #7112, since client reset recovery was implemented in v10.25.0).sort()
or distinct()
on a MutableSet<Object>
that had unresolved links in it (i.e. objects which had been deleted by a different sync client) would produce a Results with duplicate entries.App
from within a callback from the User
listener (Core #7183, since v10.42.0)SyncSession.reconnect()
, which requests an immediate reconnection if the session is currently disconnected rather than waiting for the normal reconnect delay.Added Results.subscribe
API for flexible sync. Now you can subscribe and unsubscribe to a flexible sync subscription through an object Result
.
// Named subscription query
let results = try await realm.objects(Dog.self).where { $0.age > 18 }.subscribe(name: "adults")
results.unsubscribe()
// Unnamed subscription query
let results = try await realm.objects(Dog.self).subscribe()
results.unsubscribe()
After committing the subscription to the realm's local subscription set, the method will wait for downloads according to the WaitForSyncMode
.
let results = try await realm.objects(Dog.self).where { $0.age > 1 }.subscribe(waitForSync: .always)
Where .always
will always download the latest data for the subscription, .onCreation
will do it only the first time the subscription is created, and .never
will never wait for the data to be downloaded.
This API is currently in preview and may be subject to changes in the future.
Added a new API which allows to remove all the unnamed subscriptions from the subscription set.
realm.subscriptions.removeAll(unnamedOnly: true)
-Wl,-classic_ld
to OTHER_LDFLAGS
for your application until Apple fixes the bug.MultipleSyncAgents
exception from opening a synchronized Realm in multiple processes at once no longer leaves the sync client in an invalid state. (Core #6868, since v10.36.0)Realm.Configuration.maximumNumberOfActiveVersions
now handles intermediate versions which have been cleaned up correctly and checks the number of live versions rather than the number of versions between the oldest live version and current version (since 10.35.0).RLMApp
has localAppName
and localAppVersion
fields which never ended up being used for anything and are now deprecated.RLMSyncAuthError
has not been used since v10.0.0 and is now deprecated..binaryTarget()
are now published as part of the releases on Github.Projections
not notifying when there is a property change. (#8276, since v10.34.0).UIKit
when linking Realm to a framework using SPM. (#8308, since v10.41.0)--use-xcframeworks
if installing via Carthage.