github realm/realm-swift v10.51.0

latest release: v10.52.0
19 days ago

Enhancements

  • Added support for storing nested collections (List and Map not ManagedSet) in a AnyRealmValue.

    class MixedObject: Object {
      @Persisted var anyValue: AnyRealmValue
    }
    
    // You can build a AnyRealmValue from a Swift's Dictionary.
    let dictionary: Dictionary<String, AnyRealmValue> = ["key1": .string("hello"), "key2": .bool(false)]
    
    // You can build a AnyRealmValue from a Swift's Map
    // and nest a collection within another collection.
    let list: Array<AnyRealmValue> = [.int(12), .double(14.17), AnyRealmValue.fromDictionary(dictionary)]
    
    let realm = realmWithTestPath()
    try realm.write {
      let obj = MixedObject()
      obj.anyValue = AnyRealmValue.fromArray(list)
      realm.add(obj)
    }
  • Added new operators to Swift's Query API for supporting querying nested collections.

    realm.objects(MixedObject.self).where { $0.anyValue[0][0][1] == .double(76.54) }

    The .any operator allows looking up in all keys or indexes.

    realm.objects(MixedObject.self).where { $0.anyValue["key"].any == .bool(false) }
  • Report the originating error that caused a client reset to occur.
    (Core #6154)

Fixed

  • Accessing App.currentUser from within a notification produced by App.switchToUser()
    (which includes notifications for a newly logged in user) would deadlock.
    (Core #7670, since v10.50.0).
  • Inserting the same link to the same key in a dictionary more than once would incorrectly create
    multiple backlinks to the object. This did not appear to cause any crashes later, but would
    have affecting explicit backlink count queries and possibly notifications.
    (Core #7676, since v10.49.2).
  • A non-streaming progress notifier would not immediately call its callback after registration.
    Instead you would have to wait for a download message to be received to get your first
    update - if you were already caught up when you registered the notifier you could end up waiting a
    long time for the server to deliver a download that would call/expire your notifier
    (Core #7627, since v10.50.0).
  • After compacting, a file upgrade would be triggered. This could cause loss of data
    if deleteRealmIfMigrationNeeded is set to true.
    (Core #7747, since v10.49.0).

Compatibility

  • Realm Studio: 15.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 15.4.0.
  • CocoaPods: 1.10 or later.
  • Xcode: 15.1.0-15.4.0.

Internal

  • Upgraded realm-core from v14.6.2 to 14.9.0

Don't miss a new realm-swift release

NewReleases is sending notifications on new releases.