Changelog History
Page 4
-
v10.18.0 Changes
October 25, 2021โจ Enhancements
- โ Add support for using multiple users with
@AsyncOpen
and@AutoOpen
. Setting the current user to a new user will now automatically reopen the Realm with the new user. - โ Add prebuilt binary for Xcode 13.1 to the release package.
๐ Fixed
- ๐ Fix
@AsyncOpen
and@AutoOpen
usingdefaultConfiguration
by default if the user's doesn't provide one, will set an incorrect path which doesn't correspond to the users configuration one. (since v10.12.0) - โ Adding missing subscription completion for
AsyncOpenPublisher
after successfully returning a realm.
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 13.1.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.1.
- โ Add support for using multiple users with
-
v10.17.0 Changes
October 06, 2021โจ Enhancements
- โ Add a new
@ThreadSafe
property wrapper. Objects and collections wrapped by@ThreadSafe
may be passed between threads. It's intended to allow local variables and function parameters to be used across threads when needed.
๐ Fixed
- None.
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 13.0.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0.
- โ Add a new
-
v10.16.0 Changes
September 29, 2021โจ Enhancements
- โ Add
async
versions ofEmailPasswordAuth.callResetPasswordFunction
and rUser.linkUser
methods. - โ Add
async
version ofMongoCollection
methods. - โ Add
async
support for user functions.
๐ Fixed
- A race condition in Realm.asyncOpen() sometimes resulted in subsequent writes from Realm Sync failing to produce notifications (#7447, #7453, Core #4909, since v10.15.0).
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 13.0.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0.
- โ Add
-
v10.15.1 Changes
September 15, 2021โจ Enhancements
- ๐ Switch to building the Carthage release with Xcode 13.
๐ Fixed
- ๐ Fix compilation error where Swift 5.5 is available but the macOS 12 SDK was
not. This was notable for the Xcode 13 RC. This fix adds a #canImport check
for the
_Concurrency
module that was not available before the macOS 12 SDK.
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 13.0.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0.
-
v10.15.0 Changes
September 10, 2021โจ Enhancements
- โ Add
async
versions of theRealm.asyncOpen
andApp.login
methods. - ThreadSafeReference no longer pins the source transaction version for anything other than a Results created by filtering a collection. This means that holding on to thread-safe references to other things (such as Objects) will no longer cause file size growth.
- A ThreadSafeReference to a Results backed by a collection can now be created inside a write transaction as long as the collection was not created in the current write transaction.
- ๐ Synchronized Realms are no longer opened twice, cutting the address space and file descriptors used in half. (Core #4839)
- When using the SwiftUI helper types (@ObservedRealmObject and friends) to bind to an Equatable property, self-assignment no longer performs a pointless write transaction. SwiftUI appears to sometimes call a Binding's set function multiple times for a single UI action, so this results in significantly fewer writes being performed.
๐ Fixed
- โ Adding an unmanaged object to a Realm that was declared with
@StateRealmObject
would throw the exception"Cannot add an object with observers to a Realm"
. - ๐ The
RealmCollectionChange
docs refered to indicies in modifications as the 'new' collection. This is incorrect and the docs now state that modifications refer to the previous version of the collection. (Cocoa #7390) - ๐ Fix crash in
RLMSyncConfiguration.initWithUser
error mapping when a user is disabled/deleted from MongoDB Realm dashboard. (Cocoa #7399, since v10.0.0) - ๐ฒ If the application crashed at the wrong point when logging a user in, the next run of the application could hit the assertion failure "m_state == SyncUser::State::LoggedIn" when a synchronized Realm is opened with that user. (Core #4875, since v10.0.0)
- The
keyPaths:
parameter to@ObservedResults
did not work (since v10.12.0).
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 12.5.1.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0 beta 5.
Internal
- โฌ๏ธ Upgraded realm-core from 11.3.1 to 11.4.1
- โ Add
-
v10.14.0 Changes
September 03, 2021โจ Enhancements
- โ Add additional
observe
methods for Objects and RealmCollections which take aPartialKeyPath
type key path parameter. - ๐ The release package once again contains Xcode 13 binaries.
PersistableEnum
properties can now be indexed or used as the primary key if the RawValue is an indexable or primary key type.
๐ Fixed
Map<Key, Value>
did not conform toCodable
. (Cocoa #7418, since v10.8.0)- ๐ Fixed "Invalid data type" assertion failure in the sync client when the client recieved an AddColumn instruction from the server for an AnyRealmValue property when that property already exists locally. (Core #4873, since v10.8.0)
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 12.5.1.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0 beta 5.
Internal
- โฌ๏ธ Upgraded realm-core from 11.3.0 to 11.3.1.
- โ Add additional
-
v10.13.0 Changes
August 26, 2021โจ Enhancements
- ๐ Sync logs now contain information about what object/changeset was being applied when the exception was thrown. (Core #4836)
- โ Added ServiceErrorCode for wrong username/password when using '
App.login
. (Core #7380
๐ Fixed
- ๐ Fix crash in
MongoCollection.findOneDocument(filter:)
that occurred when no results were found for a given filter. (Cocoa #7380, since v10.0.0) - Some of the SwiftUI property wrappers incorrectly required objects to conform to ObjectKeyIdentifiable rather than Identifiable. (Cocoa #7372, since v10.6.0)
- โช Work around Xcode 13 beta 3+ shipping a broken swiftinterface file for Combine on 32-bit iOS. (Cocoa #7368)
- ๐ Fixes history corruption when replacing an embedded object in a list. (Core #4845), since v10.0.0)
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 12.5.1.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0 beta 5.
Internal
- โฌ๏ธ Upgraded realm-core from 11.2.0 to 11.3.0
-
v10.12.0 Changes
August 03, 2021โจ Enhancements
Object.observe()
andRealmCollection.observe()
now include an optionalkeyPaths
parameter which filters change notifications to those only occurring on the provided key path or key paths. See method documentation for extended detail on filtering behavior.ObservedResults<ResultsType>
now includes an optionalkeyPaths
parameter which filters change notifications to those only occurring on the provided key path or key paths. ex)@ObservedResults(MyObject.self, keyPaths: ["myList.property"])
- โ Add two new property wrappers for opening a Realm asynchronously in a
SwiftUI View:
AsyncOpen
is a property wrapper that initiates Realm.asyncOpen for the current user, notifying the view when there is a change in Realm asyncOpen state.AutoOpen
behaves similarly toAsyncOpen
, but in the case of no internet connection this will return an opened realm.
- โ Add
EnvironmentValues.partitionValue
. This value can be injected into any view using one of our new property wrappersAsyncOpen
andAutoOpen
:MyView().environment(\.partitionValue, "partitionValue")
. - Shift more of the work done when first initializing a collection notifier to the background worker thread rather than doing it on the main thread.
๐ Fixed
- ๐ง
configuration(partitionValue: AnyBSON)
would always set a nil partition value for the user sync configuration. - Decoding a
@Persisted
property would incorrectly throw aDecodingError.keyNotFound
for an optional property if the key is missing. (Cocoa #7358, since v10.10.0) - ๐ Fixed a symlink which prevented Realm from building on case sensitive file systems. (#7344, since v10.8.0)
- Removing a change callback from a Results would sometimes block the calling thread while the query for that Results was running on the background worker thread (since v10.11.0).
- Object observers did not handle the object being deleted properly, which could result in assertion failures mentioning "m_table" in ObjectNotifier (Core #4824, since v10.11.0).
- ๐ Fixed a crash when delivering notifications over a nested hierarchy of lists of Mixed that contain links. (Core #4803, since v10.8.0)
- ๐ Fixed a crash when an object which is linked to by a Mixed is deleted via sync. (Core #4828, since v10.8.0)
- ๐ Fixed a rare crash when setting a mixed link for the first time which would trigger if the link was to the same table and adding the backlink column caused a BPNode split. (Core #4828, since v10.8.0)
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 12.5.1.
- CocoaPods: 1.10 or later.
- โ Xcode: 12.2-13.0 beta 4. On iOS Xcode 13 beta 2 is the latest supported version due to betas 3 and 4 having a broken Combine.framework.
Internal
- โฌ๏ธ Upgraded realm-core from v11.1.1 to v11.2.0
-
v10.11.0 Changes
July 22, 2021โจ Enhancements
- โ Add type safe methods for:
RealmCollection.min(of:)
RealmCollection.max(of:)
RealmCollection.average(of:)
RealmCollection.sum(of:)
RealmCollection.sorted(by:ascending:)
RealmKeyedCollection.min(of:)
RealmKeyedCollection.max(of:)
RealmKeyedCollection.average(of:)
RealmKeyedCollection.sum(of:)
RealmKeyedCollection.sorted(by:ascending:)
Results.distinct(by:)
- `SortDescriptor(keyPath:ascending:)
Calling these methods can now be done via Swift keyPaths, like so:
class Person: Object { @Persisted var name: String @Persisted var age: Int } let persons = realm.objects(Person.self) persons.min(of: \.age) persons.max(of: \.age) persons.average(of: \.age) persons.sum(of: \.age) persons.sorted(by: \.age) persons.sorted(by: [SortDescriptor(keyPath: \Person.age)]) persons.distinct(by: [\Person.age])
- โ Add
List.objects(at indexes:)
in Swift and[RLMCollection objectsAtIndexes:]
in Objective-C. This allows you to select elements in a collection with a given IndexSet (#7298). - โ Add
App.emailPasswordAuth.retryCustomConfirmation(email:completion:)
and[App.emailPasswordAuth retryCustomConfirmation:completion:]
. These functions support retrying a custom confirmation function. - ๐ Improve performance of creating collection notifiers for Realms with a complex schema. This means that the first run of a query or first call to observe() on a collection will do significantly less work on the calling thread.
- ๐ Improve performance of calculating changesets for notifications, particularly for deeply nested object graphs and objects which have List or Set properties with small numbers of objects in the collection.
๐ Fixed
RealmProperty<T?>
would crash when decoding anull
json value. (Cocoa #7323, since v10.8.0)@Persisted<T?>
would crash when decoding anull
value. (#7332, since v10.10.0).- ๐ Fixed an issue where
Realm.Configuration
would be set after views have been laid out when using.environment(\.realmConfiguration, ...)
in SwiftUI. This would cause issues if you are required to bump your schema version and are using@ObservedResults
. - ๐ Sync user profiles now correctly persist between runs.
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 12.5.1.
- CocoaPods: 1.10 or later.
- ๐ Xcode: 12.2-13.0 beta 3. Note that this release does not contain Xcode 13 beta binaries as beta 3 does not include a working version of Combine.framework for iOS.
Internal
- โฌ๏ธ Upgraded realm-core from 11.0.4 to 11.1.1
- โ Add type safe methods for:
-
v10.10.0 Changes
July 07, 2021โจ Enhancements
โ Add a new property wrapper-based declaration syntax for properties on Realm Swift object classes. Rather than using
@objc dynamic
or theRealmProperty
wrapper type, properties can now be declared with@Persisted var property: T
, whereT
is any of the supported property types, including optional numbers and collections. This has a few benefits:- All property types are now declared in the same way. No more remembering
that this type requires
@objc dynamic var
while this other type requireslet
, and theRealmProperty
orRealmOptional
helper is no longer needed for types not supported by Objective-C. - No more overriding class methods like
primaryKey()
,indexedProperties()
orignoredProperties()
. The primary key and indexed flags are set directly in the property declaration with@Persisted(primaryKey: true) var _id: ObjectId
or@Persisted(indexed: true) var indexedProperty: Int
. If any@Persisted
properties are present, all other properties are implicitly ignored. - Some performance problems have been fixed. Declaring collection
properties as
let listProp = List<T>()
resulted in theList<T>
object being created eagerly when the parent object is read, which could cause performance problems if a class has a large number ofList
orRealmOptional
properties.@Persisted var list: List<T>
allows us to defer creating theList<T>
until it's accessed, improving performance when looping over objects and using only some of the properties.
Similarly,
let _id = ObjectId.generate()
was a convenient way to declare a sync-compatible primary key, but resulted in new ObjectIds being generated in some scenarios where the value would never actually be used.@Persisted var _id: ObjectId
has the same behavior of automatically generating primary keys, but allows us to only generate it when actually needed.- More types of enums are supported. Any
RawRepresentable
enum whose raw type is a type supported by Realm can be stored in an@Persisted
project, rather than just@objc
enums. Enums must be declared as conforming to thePersistableEnum
protocol, and still cannot (yet) be used in collections. willSet
anddidSet
can be used with@Persistable
properties, while they previously did not work on managed Realm objects.
- All property types are now declared in the same way. No more remembering
that this type requires
While we expect the switch to the new syntax to be very simple for most users, we plan to support the existing objc-based declaration syntax for the foreseeable future. The new style and old style cannot be mixed within a single class, but new classes can use the new syntax while existing classes continue to use the old syntax. Updating an existing class to the new syntax does not change what data is stored in the Realm file and so does not require a migration (as long as you don't also change the schema in the process, of course).
- โ Add
Map.merge()
, which adds the key-value pairs from another Map or Dictionary to the map. - โ Add
Map.asKeyValueSequence()
which returns an adaptor that can be used with generic functions that operate on Dictionary-styled sequences.
๐ Fixed
- ๐ AnyRealmValue enum values are now supported in more places when creating objects.
- Declaring a property as
RealmProperty<AnyRealmValue?>
will now report an error during schema discovery rather than doing broken things when the property is used. - Observing the
invalidated
property ofRLMDictionary
/Map
via KVO did not set old/new values correctly in the notification (since 10.8.0).
Compatibility
- Realm Studio: 11.0.0 or later.
- ๐ APIs are backwards compatible with all previous releases in the 10.x.y series.
- ๐ Carthage release for Swift is built with Xcode 12.5.1.
- CocoaPods: 1.10 or later.
- Xcode: 12.2-13.0 beta 2.