Realm is a mobile database: a replacement for Core Data & SQLite

Overview

Realm

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the iOS, macOS, tvOS & watchOS versions of Realm Swift & Realm Objective-C.

Tell us about your experience

We want to hear from you! Tell us about your experience using the Realm SDKs in our short survey.

Why Use Realm

  • Intuitive to Developers: Realm’s object-oriented data model is simple to learn, doesn’t need an ORM, and lets you write less code.
  • Designed for Offline Use: Realm’s local database persists data on-disk, so apps work as well offline as they do online.
  • Built for Mobile: Realm is fully-featured, lightweight, and efficiently uses memory, disk space, and battery life.

Object-Oriented: Streamline Your Code

Realm was built for mobile developers, with simplicity in mind. The idiomatic, object-oriented data model can save you thousands of lines of code.

// Define your models like regular Swift classes
class Dog: Object {
    @Persisted var name: String
    @Persisted var age: Int
}
class Person: Object {
    @Persisted(primaryKey: true) var _id: String
    @Persisted var name: String
    @Persisted var age: Int
    // Create relationships by pointing an Object field to another Class
    @Persisted var dogs: List<Dog>
}
// Use them like regular Swift objects
let dog = Dog()
dog.name = "Rex"
dog.age = 1
print("name of dog: \(dog.name)")

// Get the default Realm
let realm = try! Realm()
// Persist your data easily with a write transaction 
try! realm.write {
    realm.add(dog)
}

Live Objects: Build Reactive Apps

Realm’s live objects mean data updated anywhere is automatically updated everywhere.

// Open the default realm.
let realm = try! Realm()

var token: NotificationToken?

let dog = Dog()
dog.name = "Max"

// Create a dog in the realm.
try! realm.write {
    realm.add(dog)
}

//  Set up the listener & observe object notifications.
token = dog.observe { change in
    switch change {
    case .change(let properties):
        for property in properties {
            print("Property '\(property.name)' changed to '\(property.newValue!)'");
        }
    case .error(let error):
        print("An error occurred: (error)")
    case .deleted:
        print("The object was deleted.")
    }
}

// Update the dog's name to see the effect.
try! realm.write {
    dog.name = "Wolfie"
}

SwiftUI

Realm integrates directly with SwiftUI, updating your views so you don't have to.

struct ContactsView: View {
    @ObservedResults(Person.self) var persons
    
    var body: some View {
        List {
            ForEach(persons) { person in
                Text(person.name)
            }
            .onMove(perform: $persons.move)
            .onDelete(perform: $persons.remove)
        }.navigationBarItems(trailing:
            Button("Add") {
                $persons.append(Person())
            }
        )
    }
}

Fully Encrypted

Data can be encrypted in-flight and at-rest, keeping even the most sensitive data secure.

// Generate a random encryption key
var key = Data(count: 64)
_ = key.withUnsafeMutableBytes { bytes in
    SecRandomCopyBytes(kSecRandomDefault, 64, bytes)
}

// Add the encryption key to the config and open the realm
let config = Realm.Configuration(encryptionKey: key)
let realm = try Realm(configuration: config)

// Use the Realm as normal
let dogs = realm.objects(Dog.self).filter("name contains 'Fido'")

Data Sync

The MongoDB Realm Sync service makes it simple to keep data in sync across users, devices, and your backend in real-time.

Getting Started

We support installing Realm via Swift Package Manager, CocoaPods, Carthage, or by importing a dynamic XCFramework.

For more information, see the detailed instructions in our docs.

Documentation

The documentation can be found at docs.mongodb.com/realm/sdk/ios/.
The API reference is located at docs.mongodb.com/realm-sdks/swift/latest/

Getting Help

  • Need help with your code?: Look for previous questions with therealm tag on Stack Overflow or ask a new question. For general discussion that might be considered too broad for Stack Overflow, use the Community Forum.
  • Have a bug to report? Open a GitHub issue. If possible, include the version of Realm, a full log, the Realm file, and a project that shows the issue.
  • Have a feature request? Open a GitHub issue. Tell us what the feature should do and why you want the feature.

Building Realm

In case you don't want to use the precompiled version, you can build Realm yourself from source.

Prerequisites:

  • Building Realm requires Xcode 11.x or newer.
  • Building Realm documentation requires jazzy

Once you have all the necessary prerequisites, building Realm.framework just takes a single command: sh build.sh build. You'll need an internet connection the first time you build Realm to download the core binary.

Run sh build.sh help to see all the actions you can perform (build ios/osx, generate docs, test, etc.).

Contributing

See CONTRIBUTING.md for more details!

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

License

Realm Objective-C & Realm Swift are published under the Apache 2.0 license.
Realm Core is also published under the Apache 2.0 license and is available here.

This product is not being made available to any person located in Cuba, Iran, North Korea, Sudan, Syria or the Crimea region, or to any other person that is not eligible to receive the product under U.S. law.

Feedback

If you use Realm and are happy with it, please consider sending out a tweet mentioning @realm to share your thoughts!

And if you don't like it, please let us know what you would like improved, so we can fix it!

analytics

Issues
  • Syncing - Distant Future?

    Syncing - Distant Future?

    Super long term, maybe not even practical, but perhaps we could see a syncing mechanism similar to Ensembles. Ensembles is really great for syncing, and as of now it would be the biggest reason for me to use Core Data over Realm for projects that require syncing.

    T-Feature 
    opened by donald-pinckney 174
  • BETA! support for NULL string & binary properties

    BETA! support for NULL string & binary properties

    This would allow for the storage of prop = [NSData data] and prop = nil;

    T-Feature 
    opened by heardrwt 141
  • Support Xcode 11 things

    Support Xcode 11 things

    • [x] Get Realm/RealmSwift building in Xcode 11 (https://github.com/realm/realm-cocoa/pull/6164)
    • [x] Swift Package Manager support as that's finally included with Xcode (https://github.com/realm/realm-cocoa/pull/6187)
    • [x] SwiftUI
    • [x] Combine framework
    • [ ] PropertyWrapper-based RealmOptional
    • [ ] Make all property types PropertyWrapper-based rather than @objc dynamic?
    • [x] Support catalyst/UIKit for Mac (requires 10.15 to build)
    • [x] Catalyst installation example/tests
    • [x] Update release packaging
    • [ ] Login with Apple for sync auth

    More things to be discovered?


    Using Realm with Xcode betas requires building from source, and typically will require using dev branches rather than releases.

    Swift Package Manager

    dependencies: [
        .package(url: "https://github.com/realm/realm-cocoa", from: "3.17.3")
    ],
    

    Targets named "Realm" and "RealmSwift" (for the obj-c and swift APIs respectively) are exported from the package. SPM support is currently experimental and does not support Realm Sync.

    Carthage

    github "realm/realm-cocoa" "master"
    
    DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer carthage bootstrap -no-use-binaries
    

    CocoaPods

      pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
      pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
    

    Explicitly including the Realm pod as a dependency is required as otherwise it'll try to use the latest release of the obj-c part.

    Manual framework

    git clone --recursive https://github.com/realm/realm-cocoa.git
    cd realm-cocoa
    DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer sh build.sh build
    

    Built frameworks are in the build directory.

    T-Enhancement P-1-Required 
    opened by tgoyne 126
  • distinct query in Realm database

    distinct query in Realm database

    hello, realm is super fast db but very necessary distinct query from database e.g. schedules = Schedules.objectsWhere("areas.id = '(idAreas)' distict")

    T-Feature P-2-Expected 
    opened by alexwillrock 70
  • Realm as a C/C++ library, and API?

    Realm as a C/C++ library, and API?

    (Not sure this question belongs here, but couldn't find a better place...)

    Our app uses a shared C++ model layer across iOS/Android. Currently that layer uses sqlite3 for DB storage. We'd love to take a look at Realm, but we'd need to be able to link the core C/C++ library, and interface to it in C/C++.

    I seem to remember bringing this up about a year ago, and Realm said it should be do-able... I assume the core layer is already C/C++.

    Is it on the roadmap?

    T-Feature O-Community Pipeline-Idea-Backlog 
    opened by timcloss 65
  • Support sorting by keypath

    Support sorting by keypath

    Lets say I have:

     class Quote: RLMObject {
       dynamic var sentence = ""
     }
    

    Could I sort an RLMResults, generated by a query, by the length of the sentence property?

    T-Enhancement 
    opened by webmagnets 61
  • mmap() failed: Cannot allocate memory size: 3221225472 offset: 0

    mmap() failed: Cannot allocate memory size: 3221225472 offset: 0

    Bug

    I am currently doing as you suggested and I am still seeing this issue appearing in production for close to 10% of our users. This is also extremely hard to debug since I am unable to get a copy of the database from our users in the alpha.

    I am running the shouldCompactOnLaunch as well as wrapping the writes in autoreleasepool so they aren't kept in memory, as well as accessing the items one by one for processing before syncing to the server. I have tried all the steps outlined in several users issues that around the same problem.

    Basically, I am using realm as an intermediate store for location data before sending up to the server, I went down the route of limiting the number of items choose to send up between sends but since they are lazily accessed this proves to be not the issue.

    Goals

    I would like to be able to simply read values that haven't been pushed up since the last sync to our servers and store new values as they come in, to be synced in the future. I am not using realm server for this.

    Expected Results

    I expect to be able to read the data from the database with the predicate set to get the new location data that has been created since the last sync.

    Actual Results

    All I keep getting is this message that other have seen elsewhere.

    mmap() failed: Cannot allocate memory size: 3221225472 offset: 0
    

    Which then causes an entire application to crash. Which also seems quite high considering my shouldCompactOnLaunch code.

    Steps to Reproduce

    All I am doing is a simple read and the application crashes from what I gather it isn't able to read from the database since it needs to move it into memory before the read and it cannot do so. I have tried the shouldCompactOnLaunch strategy as well as wrapping reads in autoreleasepool

    Code Sample

    Here is shouldCompactOnLaunch code

    RLMRealmConfiguration *config = [RLMRealmConfiguration defaultConfiguration];
      config.shouldCompactOnLaunch = ^BOOL(NSUInteger totalBytes, NSUInteger usedBytes){
        // totalBytes refers to the size of the file on disk in bytes (data + free space)
        // usedBytes refers to the number of bytes used by data in the file
        
        // Compact if the file is over 10MB in size and less than 50% 'used'
        NSUInteger tenMB = 10 * 1024 * 1024;
        return (totalBytes > tenMB) && (usedBytes / totalBytes) < 0.5;
      };
      
      NSError *error = nil;
      // Realm is compacted on the first open if the configuration block conditions were met.
      RLMRealm *realm = [RLMRealm realmWithConfiguration:config error:&error];
      if (error) {
        // handle error compacting or opening Realm
        NSLog(@"%@", error);
      }
      
    

    Here is read that is causing the crash

      NSDate *lastSync = [self getVisitAnchor];
    
      NSPredicate *_today = [NSPredicate predicateWithFormat:@"endTime >= %@", lastSync];
      RLMResults<Visit *> *visits = [Visit objectsWithPredicate:_today];
      
      NSDate *lastVisitTime = [visits lastObject].startTime;
      
      NSMutableArray *visitArray = [[NSMutableArray alloc] init];
      
      for (NSInteger i = 0; i < [visits count]; i++) {
        // create an array structure.
        NSDictionary *visitData = [self serializeRealmVisit:visits[i]];
        [visitArray addObject:visitData];
      }
      
    

    Which is what triggers the crash, here is the associated stack trace

    Fatal Exception: RLMException
    0  CoreFoundation                 0x191706fe0 __exceptionPreprocess
    1  libobjc.A.dylib                0x190168538 objc_exception_throw
    2  Realm                          0x10076f908 (Missing)
    3  Realm                          0x100750d34 (Missing)
    4  Realm                          0x100751e3c (Missing)
    5  Realm                          0x100751bcc (Missing)
    6  Realm                          0x1007502e8 (Missing)
    7  Realm                          0x1006e4a50 (Missing)
    8  Application                      0x10010e308 -[LocationManager sendVisits] (LocationManager.m:225)
    9  Application                      0x10010dd74 -[LocationManager sendData] (LocationManager.m:161)
    10 Application                      0x10010ddb0 -[LocationManager startMonitoring] (LocationManager.m:166)
    11 Application                      0x10010c9a4 -[AppDelegate startMonitoring] (AppDelegate.m:112)
    12 Application                      0x10010c818 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:106)
    13 UIKit                          0x1978a9e48 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:]
    14 UIKit                          0x197ab637c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:]
    15 UIKit                          0x197abbe24 -[UIApplication _runWithMainScene:transitionContext:completion:]
    16 UIKit                          0x197ad08b0 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3147
    17 UIKit                          0x197ab90b8 -[UIApplication workspaceDidEndTransaction:]
    18 FrontBoardServices             0x1932b0884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
    19 FrontBoardServices             0x1932b06f0 -[FBSSerialQueue _performNext]
    20 FrontBoardServices             0x1932b0aa0 -[FBSSerialQueue _performNextFromRunLoopSource]
    21 CoreFoundation                 0x1916b542c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
    22 CoreFoundation                 0x1916b4d9c __CFRunLoopDoSources0
    23 CoreFoundation                 0x1916b29a8 __CFRunLoopRun
    24 CoreFoundation                 0x1915e2da4 CFRunLoopRunSpecific
    25 UIKit                          0x1978a2fc8 -[UIApplication _run]
    26 UIKit                          0x19789dc9c UIApplicationMain
    27 Application                      0x1001199d4 main (main.m:16)
    28 libdyld.dylib                  0x1905f159c start
    

    Version of Realm and Tooling

    Realm framework version: 3.0.2

    Xcode version: 9.1

    iOS/OSX version: 10, 11

    T-Help Reproduction-Required P-1-Required O-Community 
    opened by myusuf3 59
  • Confine on dispatch queue rather than thread

    Confine on dispatch queue rather than thread

    tl;dr Realm uses thread ids and throws exceptions when they change. Checking thread ID is not acceptable under GCD.

    Realm docs state objects are not gcd queue safe and when running under GCD:

    you must get an RLMRealm instance in each thread/dispatch_queue in which you want to read or write

    I do this:

        // Local copy of the persisted task valid for the worker queue.
    __block OFEPersistedTask* taskCopyOnWorkerQueue = nil;
    
    NSString* taskID = aTask.taskID;
    dispatch_sync(_workerQueue, ^{
        NSPredicate *pred = [NSPredicate predicateWithFormat:@"taskID = %@", taskID];
        RLMResults *results = [OFEPersistedTask objectsWithPredicate:pred];
        taskCopyOnWorkerQueue = [results firstObject];
    }
    

    To get a copy of my Task (RLMObject subclass) on the correct queue. Unfortunately, in RLMVerifyAttached Realm checks the thread ID through RLMCheckThread (i.e. not queue) which does not work under GCD.

    A GCD queue can run its tasks on many different threads - thats kindof the point. From the Apple docs:

    The currently executing task runs on a distinct thread (which can vary from task to task)

    My emphasis... So, even if I grab a RLMObject on my queue I still risk getting killed (actually, no risk, I do get killed) later for running on the wrong thread.

    The only workaround I can think of is to store a primary key with __block scope and then perform another Realm fetch at the beginning of every task. That feels so suboptimal I don't think you can claim Realm is compatible with GCD at all.

    T-Enhancement Blocked 
    opened by rogernolan 58
  • Support storing arrays of primitives (string, int, etc.) as RLMObject properties

    Support storing arrays of primitives (string, int, etc.) as RLMObject properties

    Reading over issue #1028 it looks like RLMObject doesn't support properties that are arrays of non-RLMObjects. Instead the individual strings each have to be declared as a property of an RLMObject and then stored in an RLMArray.

    I'm curious to understand why your support for primitives doesn't extend to collections of objects of those types. As far as Realm is concerned, what's the difference between storing a string or an array of strings? And would you ever add this support to a future release?


    Subtasks:

    • [x] Non-breaking changes for arrays of primitives (#5148)
    • [x] Breaking API changes for arrays of primitives (#5149)
    • [x] Basic support for arrays of primitives (#5274)
    • [x] Query support for arrays of primitives (#5334)
    T-Feature P-2-Expected 
    opened by andrewjl 53
  • pod install 0.95.0 failed

    pod install 0.95.0 failed

    Try to install realm with Cocoapods, I got the message below

    Installing Realm (0.95.0)
    [!] /bin/bash -c
    set -e
    sh build.sh cocoapods-setup
    
    core is not a symlink. Deleting...
    Downloading dependency: core 0.92.1.1
    Downloading core failed. Please try again once you have an Internet connection.
    

    and pod version:

    pod --version
    0.38.2
    
    opened by goreycn 49
  • Add a basic test for the .objectSchema property on MigrationObject

    Add a basic test for the .objectSchema property on MigrationObject

    Prompted by #7450 as I couldn't find any tests that actually exercised that, and it's plausible that reading the schema from a DynamicObject could fail as they're kinda weird. Appears to work fine in the simple case, though.

    opened by tgoyne 0
  • Crash during migration when accessing ObjectSchema

    Crash during migration when accessing ObjectSchema

    How frequently does the bug occur?

    All the time

    Description

    Hi,

    I migrated my Realm models to use EmbeddedObjects and I received some crash reports from this migration.

    I have a simple safeGet(key: String) -> Any? function as extension on DynamicObject which checks object schema whether it contains property with given name and then returns the value:

    extension DynamicObject {
        fileprivate func safeGet(key: String) -> Any? {
            guard self.objectSchema.properties.contains(where: { $0.name == key }) else {
                return nil
            }
            return self[key]
        }
    }
    

    The app crashes when trying to access this object schema. Should I also check for isInvalidated flag before accessing the object or is this related to something else entirely?

    Stacktrace & log output

    Incident Identifier: 6F7DC0D0-FD03-45EF-858B-37C2DBA9FC15
    Hardware Model:      iPad13,11
    Process:             Zotero [1598]
    Path:                /private/var/containers/Bundle/Application/D4E24841-4108-455B-92F2-995F594ECA9E/Zotero.app/Zotero
    Identifier:          org.zotero.ios.Zotero
    Version:             1.0 (151)
    AppStoreTools:       13A227
    AppVariant:          1:iPad13,11:15
    Beta:                YES
    Code Type:           ARM-64 (Native)
    Role:                unknown
    Parent Process:      launchd [1]
    Coalition:           org.zotero.ios.Zotero [923]
    
    Date/Time:           2021-09-22 18:06:00.0597 -0700
    Launch Time:         2021-09-22 18:05:58.0544 -0700
    OS Version:          iPhone OS 15.0 (19A346)
    Release Type:        User
    Baseband Version:    2.09.10
    Report Version:      104
    
    Exception Type:  EXC_CRASH (SIGKILL)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY
    Triggered by Thread:  0
    
    
    Kernel Triage:
    VM - pmap_enter failed with resource shortage
    VM - pmap_enter failed with resource shortage
    VM - pmap_enter failed with resource shortage
    VM - pmap_enter failed with resource shortage
    VM - pmap_enter failed with resource shortage
    
    
    Thread 0 name:
    Thread 0 Crashed:
    0   libswiftCore.dylib            	0x0000000187002f5c swift_dynamicCastObjCClassImpl(void const*, swift::TargetClassMetadata<swift::InProcess> const*) + 44 (SwiftObject.mm:1070)
    1   Zotero                        	0x0000000104a08170 specialized _ArrayBuffer._getElementSlowPath(_:) + 164
    2   Zotero                        	0x0000000104a2fa24 specialized Array._getElement(_:wasNativeTypeChecked:matchingSubscriptCheck:) + 16 (<compiler-generated>:0)
    3   Zotero                        	0x0000000104a2fa24 specialized Array.subscript.getter + 20 (<compiler-generated>:0)
    4   Zotero                        	0x0000000104a2fa24 specialized Array.subscript.read + 20 (<compiler-generated>:0)
    5   Zotero                        	0x0000000104a2fa24 specialized protocol witness for Collection.subscript.read in conformance [A] + 20 (<compiler-generated>:0)
    6   Zotero                        	0x0000000104a2fa24 specialized Collection.map<A>(_:) + 80 (<compiler-generated>:0)
    7   Zotero                        	0x0000000104a2fa24 ObjectSchema.properties.getter + 196 (ObjectSchema.swift:42)
    8   Zotero                        	0x0000000104489784 DynamicObject.safeGet(key:) + 112 (Database.swift:463)
    9   Zotero                        	0x000000010448c668 closure #1 in static Database.migrateLinkedChildren(ofType:parentType:oldLinkPropertyName:newListPropertyName:migration:) + 180 (Database.swift:317)
    10  Zotero                        	0x0000000104a1e51c closure #1 in Migration.enumerateObjects(ofType:_:) + 32 (Migration.swift:106)
    11  Zotero                        	0x0000000104a1e51c partial apply for closure #1 in Migration.enumerateObjects(ofType:_:) + 64 (<compiler-generated>:0)
    12  Zotero                        	0x0000000104a1e560 thunk for @callee_guaranteed (@guaranteed RLMObject?, @guaranteed RLMObject?) -> () + 4 (<compiler-generated>:0)
    13  Zotero                        	0x0000000104a1e560 partial apply for thunk for @callee_guaranteed (@guaranteed RLMObject?, @guaranteed RLMObject?) -> () + 20
    14  Zotero                        	0x0000000104a1e5b0 thunk for @escaping @callee_guaranteed (@guaranteed RLMObject?, @guaranteed RLMObject?) -> () + 68 (<compiler-generated>:0)
    15  Zotero                        	0x00000001048ceee4 -[RLMMigration enumerateObjects:block:] + 1148 (RLMMigration.mm:121)
    16  Zotero                        	0x0000000104a1e468 Migration.enumerateObjects(ofType:_:) + 220 (Migration.swift:105)
    17  Zotero                        	0x000000010448ed34 specialized static Database.migrateLinkedChildren(ofType:parentType:oldLinkPropertyName:newListPropertyName:migration:) + 228 (Database.swift:312)
    18  Zotero                        	0x000000010448fecc static Database.migrateLinkedChildren(ofType:parentType:oldLinkPropertyName:newListPropertyName:migration:) + 48 (<compiler-generated>:0)
    19  Zotero                        	0x000000010448fecc specialized static Database.migrateEmbeddedObjects(migration:) + 812 (Database.swift:164)
    20  Zotero                        	0x00000001044894b8 static Database.migrateEmbeddedObjects(migration:) + 8 (<compiler-generated>:0)
    21  Zotero                        	0x00000001044894b8 closure #1 in static Database.createMigrationBlock(fileStorage:) + 248 (Database.swift:52)
    22  Zotero                        	0x0000000104a1ea24 closure #1 in accessorMigrationBlock(_:) + 612 (Migration.swift:195)
    23  Zotero                        	0x0000000104a48174 thunk for @escaping @callee_guaranteed (@guaranteed RLMMigration, @unowned UInt64) -> () + 44 (<compiler-generated>:0)
    24  Zotero                        	0x00000001048cf2f8 -[RLMMigration execute:] + 692 (RLMMigration.mm:137)
    25  Zotero                        	0x00000001049b9500 +[RLMRealm realmWithConfiguration:queue:error:]::$_1::operator()(std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Schema&) const + 368 (RLMRealm.mm:483)
    26  Zotero                        	0x00000001049b9500 decltype(std::__1::forward<+[RLMRealm realmWithConfiguration:queue:error:]::$_1&>(fp)(std::__1::forward<std::__1::shared_ptr<realm::Realm> >(fp0), std::__1::forward<std::__1::shared_ptr<realm::Real... + 384 (type_traits:3694)
    27  Zotero                        	0x00000001049b9500 void std::__1::__invoke_void_return_wrapper<void, true>::__call<+[RLMRealm realmWithConfiguration:queue:error:]::$_1&, std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm:... + 384 (__functional_base:348)
    28  Zotero                        	0x00000001049b9500 std::__1::__function::__alloc_func<+[RLMRealm realmWithConfiguration:queue:error:]::$_1, std::__1::allocator<+[RLMRealm realmWithConfiguration:queue:error:]::$_1>, void (std::__1::shared_ptr<realm:... + 384 (functional:1558)
    29  Zotero                        	0x00000001049b9500 std::__1::__function::__func<+[RLMRealm realmWithConfiguration:queue:error:]::$_1, std::__1::allocator<+[RLMRealm realmWithConfiguration:queue:error:]::$_1>, void (std::__1::shared_ptr<realm::Realm... + 424 (functional:1732)
    30  Zotero                        	0x0000000104ba3bb4 std::__1::__function::__value_func<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Schema&)>::operator()(std::__1::shared_ptr<realm::Realm>&&, std::__1::shared_... + 20 (functional:1885)
    31  Zotero                        	0x0000000104ba3bb4 std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Schema&)>::operator()(std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>,... + 20 (functional:2560)
    32  Zotero                        	0x0000000104ba3bb4 realm::Realm::update_schema(realm::Schema, unsigned long long, std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Schema&)>, std::__1::function<... + 320 (shared_realm.cpp:409)
    33  Zotero                        	0x0000000104ba3bb4 decltype(std::__1::forward<realm::Realm::update_schema(realm::Schema, unsigned long long, std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Sch... + 320 (type_traits:3694)
    34  Zotero                        	0x0000000104ba3bb4 void std::__1::__invoke_void_return_wrapper<void, true>::__call<realm::Realm::update_schema(realm::Schema, unsigned long long, std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1:... + 320 (__functional_base:348)
    35  Zotero                        	0x0000000104ba3bb4 std::__1::__function::__alloc_func<realm::Realm::update_schema(realm::Schema, unsigned long long, std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, re... + 320 (functional:1558)
    36  Zotero                        	0x0000000104ba3bb4 std::__1::__function::__func<realm::Realm::update_schema(realm::Schema, unsigned long long, std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::S... + 368 (functional:1732)
    37  Zotero                        	0x0000000104b626e8 std::__1::__function::__value_func<void ()>::operator()() const + 20 (functional:1885)
    38  Zotero                        	0x0000000104b626e8 std::__1::function<void ()>::operator()() const + 20 (functional:2560)
    39  Zotero                        	0x0000000104b626e8 realm::ObjectStore::apply_schema_changes(realm::Transaction&, unsigned long long, realm::Schema&, unsigned long long, realm::SchemaMode, std::__1::vector<realm::SchemaChange, std::__1::allocator<re... + 1860 (object_store.cpp:906)
    40  Zotero                        	0x0000000104ba1734 realm::Realm::update_schema(realm::Schema, unsigned long long, std::__1::function<void (std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Schema&)>, std::__1::function<... + 520 (shared_realm.cpp:422)
    41  Zotero                        	0x00000001049b49f0 +[RLMRealm realmWithConfiguration:queue:error:] + 1704 (RLMRealm.mm:491)
    42  Zotero                        	0x0000000104a3b238 specialized @nonobjc RLMRealm.__allocating_init(configuration:queue:) + 40 (<compiler-generated>:0)
    43  Zotero                        	0x0000000104a3b238 @nonobjc RLMRealm.__allocating_init(configuration:queue:) + 40 (<compiler-generated>:0)
    44  Zotero                        	0x0000000104a3b238 Realm.init(configuration:queue:) + 88 (Realm.swift:92)
    45  Zotero                        	0x0000000104493760 RealmDbCoordinator.init(config:) + 28 (RealmDbStorage.swift:57)
    46  Zotero                        	0x0000000104493760 RealmDbStorage.createCoordinator() + 48 (RealmDbStorage.swift:49)
    47  Zotero                        	0x0000000104493760 protocol witness for DbStorage.createCoordinator() in conformance RealmDbStorage + 48 (<compiler-generated>:48)
    48  Zotero                        	0x0000000104493760 RealmObjectUserChangeObserver.setupObserving() + 220 (ObjectUserChangeObserver.swift:36)
    49  Zotero                        	0x00000001044d3bf8 RealmObjectUserChangeObserver.init(dbStorage:) + 16 (ObjectUserChangeObserver.swift:31)
    50  Zotero                        	0x00000001044d3bf8 RealmObjectUserChangeObserver.__allocating_init(dbStorage:) + 16 (ObjectUserChangeObserver.swift:28)
    51  Zotero                        	0x00000001044d3bf8 specialized UserControllers.init(userId:controllers:) + 1036 (Controllers.swift:226)
    52  Zotero                        	0x00000001044d1804 UserControllers.init(userId:controllers:) + 16 (Controllers.swift:0)
    53  Zotero                        	0x00000001044d1804 UserControllers.__allocating_init(userId:controllers:) + 16 (Controllers.swift:135)
    54  Zotero                        	0x00000001044d1804 Controllers.initializeSession(with:isLogin:debugLogging:) + 208
    55  Zotero                        	0x00000001044d1100 Controllers.update(with:isLogin:debugLogging:) + 40 (Controllers.swift:119)
    56  Zotero                        	0x00000001044d0ce8 Controllers.init() + 2552 (Controllers.swift:86)
    57  Zotero                        	0x00000001045f6958 Controllers.__allocating_init() + 28 (Controllers.swift:0)
    58  Zotero                        	0x00000001045f6958 specialized AppDelegate.application(_:didFinishLaunchingWithOptions:) + 592 (AppDelegate.swift:197)
    59  Zotero                        	0x00000001045f5878 AppDelegate.application(_:didFinishLaunchingWithOptions:) + 4 (<compiler-generated>:0)
    60  Zotero                        	0x00000001045f5878 @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 132
    61  UIKitCore                     	0x00000001849dffe8 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356 (UIApplication.m:2292)
    62  UIKitCore                     	0x0000000184bc854c -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3524 (UIApplication.m:2704)
    63  UIKitCore                     	0x0000000184bb0eb8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1208 (UIApplication.m:4437)
    64  UIKitCore                     	0x0000000184a0dfd0 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 216 (_UISceneLifecycleMultiplexer.m:452)
    65  UIKitCore                     	0x0000000184a0d414 -[UIApplication _compellApplicationLaunchToCompleteUnconditionally] + 68 (UIApplication.m:3347)
    66  UIKitCore                     	0x0000000184bd1098 -[UIApplication _run] + 1064 (UIApplication.m:0)
    67  UIKitCore                     	0x000000018494ebe8 UIApplicationMain + 2124 (UIApplication.m:5013)
    68  Zotero                        	0x000000010432cc1c main + 204 (main.swift:13)
    69  dyld                          	0x000000010542da24 start + 520 (dyldMain.cpp:876)
    
    Thread 1:
    0   libsystem_pthread.dylib       	0x00000001f15acf48 start_wqthread + 0
    
    Thread 2:
    0   libsystem_pthread.dylib       	0x00000001f15acf48 start_wqthread + 0
    
    Thread 3:
    0   libsystem_pthread.dylib       	0x00000001f15acf48 start_wqthread + 0
    
    Thread 4:
    0   libsystem_pthread.dylib       	0x00000001f15acf48 start_wqthread + 0
    
    Thread 5 name:
    Thread 5:
    0   libsystem_kernel.dylib        	0x00000001b809c564 mach_msg_trap + 8
    1   libsystem_kernel.dylib        	0x00000001b809cbfc mach_msg + 76 (mach_msg.c:119)
    2   CoreFoundation                	0x0000000182213698 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
    3   CoreFoundation                	0x000000018221798c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
    4   CoreFoundation                	0x000000018222b3c8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
    5   Foundation                    	0x0000000183a4ed54 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
    6   Foundation                    	0x0000000183a906a8 -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
    7   UIKitCore                     	0x0000000184b4a07c -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
    8   Foundation                    	0x0000000183a9e95c __NSThread__start__ + 792 (NSThread.m:915)
    9   libsystem_pthread.dylib       	0x00000001f15ada60 _pthread_start + 148 (pthread.c:890)
    10  libsystem_pthread.dylib       	0x00000001f15acf5c thread_start + 8
    
    Thread 6:
    0   libsystem_kernel.dylib        	0x00000001b809c564 mach_msg_trap + 8
    1   libsystem_kernel.dylib        	0x00000001b809cbfc mach_msg + 76 (mach_msg.c:119)
    2   Zotero                        	0x0000000104d188c8 exception_server_thread + 188 (PLCrashMachExceptionServer.m:674)
    3   libsystem_pthread.dylib       	0x00000001f15ada60 _pthread_start + 148 (pthread.c:890)
    4   libsystem_pthread.dylib       	0x00000001f15acf5c thread_start + 8
    
    Thread 7 name:
    Thread 7:
    0   libsystem_kernel.dylib        	0x00000001b809dedc kevent + 8
    1   Zotero                        	0x0000000104b2d4a4 realm::_impl::ExternalCommitHelper::listen() + 160 (external_commit_helper.cpp:220)
    2   Zotero                        	0x0000000104b2de6c realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0::operator()() const + 4 (external_commit_helper.cpp:176)
    3   Zotero                        	0x0000000104b2de6c decltype(std::__1::forward<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0>(fp)()) std::__1::__invoke<realm::_impl::ExternalCommitHelper::ExternalComm... + 4 (type_traits:3694)
    4   Zotero                        	0x0000000104b2de6c void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm... + 4 (thread:286)
    5   Zotero                        	0x0000000104b2de6c void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, realm::_impl::ExternalCommitHelper::ExternalCom... + 52 (thread:297)
    6   libsystem_pthread.dylib       	0x00000001f15ada60 _pthread_start + 148 (pthread.c:890)
    7   libsystem_pthread.dylib       	0x00000001f15acf5c thread_start + 8
    
    
    Thread 0 crashed with ARM Thread State (64-bit):
        x0: 0x0000000000000001   x1: 0x0000000105050258   x2: 0x0000000105050258   x3: 0x0000000000000000
        x4: 0x0000000000180080   x5: 0x0000000104fb15d0   x6: 0x0000000000000001   x7: 0x0000000000000000
        x8: 0x0000000105050258   x9: 0x0000000000000000  x10: 0x01000001dc033d01  x11: 0x02000001dc033d01
       x12: 0x0000000000aa7c00  x13: 0x02000001dc033d01  x14: 0x0000000000020000  x15: 0x00000001dc033d00
       x16: 0x0000000105050258  x17: 0x0000000105050258  x18: 0x0000000000000000  x19: 0x00000002835e8af0
       x20: 0x0000000105050258  x21: 0x4000000281047e40  x22: 0x0000000281047e40  x23: 0x0000000000000024
       x24: 0x00000002835e8a80  x25: 0x0000000000000024  x26: 0x4000000000000000  x27: 0x0000000000000023
       x28: 0x0000000293591ce0   fp: 0x000000016bad51f0   lr: 0x0000000187002f5c
        sp: 0x000000016bad51d0   pc: 0x0000000187002f5c cpsr: 0x60000000
       esr: 0x92000047 (Data Abort) byte write Translation fault
    
    
    Binary Images:
    0x104328000 - 0x104f4bfff Zotero arm64  <68a47896705f3e71a5acb3e663d638a8> /private/var/containers/Bundle/Application/D4E24841-4108-455B-92F2-995F594ECA9E/Zotero.app/Zotero
    0x105414000 - 0x10546bfff dyld arm64e  <d48c31ee061f370ba6f78391a1b53ed8> /usr/lib/dyld
    0x18220c000 - 0x18265ffff CoreFoundation arm64e  <6174789ae88c3f5cba39de2e9edc0750> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    0x183a36000 - 0x183d3afff Foundation arm64e  <efbca2ff8b8c3227abbc154ba851d23c> /System/Library/Frameworks/Foundation.framework/Foundation
    0x1846b6000 - 0x185f38fff UIKitCore arm64e  <0e2d8679d5f13c0390107f6ce3662789> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
    0x186c39000 - 0x18708afff libswiftCore.dylib arm64e  <72fa4715bab939628897857fe8953ddc> /usr/lib/swift/libswiftCore.dylib
    0x1b809b000 - 0x1b80cefff libsystem_kernel.dylib arm64e  <d2476f74d204348d8d386165d0485c7c> /usr/lib/system/libsystem_kernel.dylib
    0x1f15ac000 - 0x1f15b7fff libsystem_pthread.dylib arm64e  <bc1ce0c6a9f2396b9afb623d3acd5881> /usr/lib/system/libsystem_pthread.dylib
    
    EOF
    

    Can you reproduce the bug?

    Not yet

    Reproduction Steps

    No response

    Version

    10.13.0

    What SDK flavour are you using?

    Local Database only

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    iOS 15

    Build environment

    Xcode version: ... Dependency manager and version: ...

    T-Bug O-Community 
    opened by michalrentka 3
  • Even if list is effectively not modified in a transaction, change notifications still fire

    Even if list is effectively not modified in a transaction, change notifications still fire

    How frequently does the bug occur?

    All the time

    Description

    If a realm object has a realmlist as a property, and then within the transaction there are modifications to that realmlist (but the modifications cancel each other out), that is different

    // define the person class
    class Person: Object {
    @Persisted var ID: String!
    @Persisted var name = ""
    let friends = List<Person>()
    }
    

    Now if we we have two Person objects in the realm database, where person1 has friend person2:

    try? realm.write { \
      let person1 = Person(ID: "id1")
      person1.name = "Alex"
      let person2 = Person(ID: "id2")
      person2.name = "Bella"
      realm.add([person1, person2], update: .modified) 
      person1.friends.append(person2)
    }
    

    Now consider if we began observe change notifications for person1

    let token = person1.observe { change in
       print("Change Notification Fired!")
    }
    

    The following realm transactions, which are equivalent, actually trigger different numbers of change notifications.

    Variation1:

    try? realm.write {
      // note the friends list is the same before and after this transaction. Yet a change notification is fired.
      person1.friends.removeAll()
      person1.friends.append(person2)
      person2.name = "Isabella" // no change notification
    }
    

    Variation2

    try? realm.write {
      person2.name = "Isabella" // no change notification
    }
    

    Stacktrace & log output

    No response

    Can you reproduce the bug?

    Yes, always

    Reproduction Steps

    See above code.

    Version

    10.15.1

    What SDK flavour are you using?

    Local Database only

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    iOS 14.8

    Build environment

    Xcode version: 13 GM Dependency manager and version: Cocoapods, 1.10

    T-Bug O-Community 
    opened by winstondu 3
  • Unlock Self for observable types

    Unlock Self for observable types

    This PR does a number of things. The downside of these things is that observe will be less discoverable in our docs, but it does consolidate a lot of code, makes our API more type safe, and removes functionality that didn't really work:

    • Disallow key path observation on collections where the Element is not of Object type. Attempting to observe keyPaths on non-object types yields no changes, so this functionality was already broken.
      • @tgoyne I am not sure how we feel about this. It breaks the API for those that were using it incorrectly.
    • Unlock Self for observable types. By moving object observation behind a private protocol, and collection observation cleaned up, key path filtering and Object/CollectionChanges have become more type safe. Previously, keyPath filtering was called as:
    person.observe(keyPaths: [\Person.name, \Person.age]) { change in /* do stuff */ }
    

    Now the class can be dropped, as it is derived from the calling type:

    person.observe(keyPaths: [\.name, \.age]) { change in /* do stuff */ }
    

    Non-keyPath filtering has also been enhanced. Previously:

    person.observe { change in
    	  switch change {
    	  case .initial(let object):
    		// type is of ObjectBase and needs to be casted
    		guard let person = object as? Person else { fatalError() }
    		// do stuff
    	  default: break
    	  }
    }
    

    Now:

    person.observe { change in
    	  switch change {
    	  case .initial(let person):
    		// person is already of `Person` type
    	  }
    }
    

    The above is all unlocked for collection observation as well.

    • Consolidate observation logic to RealmCollection.
    opened by jsflax 2
  • RealmSwift: @ObservedResults not updating with Realm Sync

    RealmSwift: @ObservedResults not updating with Realm Sync

    How frequently does the bug occur?

    All the time

    Description

    I’m trying to use Realm Sync for a basic CRUD app using SwiftUI, but for some reason the @ObservedResults property wrapper is not updating my view when I add/delete objects.

    The Realm App is set up on the free shared tier. When I insert/delete entries, I can see in the Realm App logs that the data is being inserted/deleted appropriately in the collection. The problem is that the SwiftUI View (using the @ObservedResults wrapper) does not update appropriately. On the other hand, if I quit and restart the iOS app, any insertions/deletions I’ve made DO show up.

    I brought this up on the forums and was asked to file an issue here.

    Stacktrace & log output

    No response

    Can you reproduce the bug?

    Yes, always

    Reproduction Steps

    Relevant portions of code:

    
    let app = RealmSwift.App(id: "[XXXXXXXXX]")
    
    class AppState: ObservableObject {
        @Published var userID: String?
    }
    
    @main
    struct RepositoryRealm_App: SwiftUI.App {
        @StateObject var appState = AppState()
        var body: some Scene {
            WindowGroup {
                switch appState.userID {
                case nil:
                    Text("XXXX")
                        .onAppear {
                            switch app.currentUser {
                            case nil:
                                app.login(credentials: .anonymous) { result in
                                    DispatchQueue.main.async {
                                        switch result {
                                        case .failure(let error):
                                            fatalError(error.localizedDescription)
                                        case .success(let user):
                                            let partitionValue = user.id
                                            appState.userID = partitionValue
                                        }
                                    }
                                }
                                
                            case let currentUser?:
                                let partitionValue = currentUser.id
                                appState.userID = partitionValue
                            }
                        }
                    
                case let userID:
                    ContentView()
                        .environmentObject(appState)
                        .environment(\.partitionValue, userID)
                }
            }
        }
    }
    
    struct ContentView: View {
        @AsyncOpen(appId: "[XXXXXXXXX]", partitionValue: "", timeout: 5000) var asyncOpen
        var body: some View {
            switch asyncOpen {
            case .connecting:
                Text("Connecting...")
            case .waitingForUser:
                Text("Waiting for user...")
            case .open(let userRealm):
                EntryObjectListView()
                    .environment(\.realm, userRealm)
            case .progress(let progress):
                ProgressView(progress)
            case .error(let error):
                fatalError(error.localizedDescription)
            }
        }
    }
    
    struct EntryObjectListView: View {
        @EnvironmentObject var appState: AppState
        @ObservedResults(EntryObject.self) var entryObjects
        
        var body: some View {
            NavigationView {
                VStack {
    
                    List {
                        ForEach(entryObjects) { entryObject in
                            Text(entryObject.title)
                        }
                        .onDelete(perform: $entryObjects.remove)
                    }
                    Spacer()
                    Button("add text", systemImage: "plus") {
    
                        let entryObject = EntryObject(dataType: TextData.self)
                        entryObject.title = "hello text!"
                        entryObject._partition = appState.userID!
    
                        $entryObjects.append(entryObject)
                    }
                    Button("delete all", systemImage: "minus") {
                        withAnimation {
                            for entryObject in entryObjects {
                                $entryObjects.remove(entryObject)
                            }
                        }
                    }
                    Button("print count", systemImage: "minus") {
                        print(entryObjects.count)
                    }
                }
            }
        }
    }
    
    final class EntryObject: Object, ObjectKeyIdentifiable {
        
        @Persisted(primaryKey: true) var _id = UUID()
        @Persisted var _partition: String = ""
        @Persisted var type: EntryType = .undefined
        @Persisted var dateCreated: Date = Date()
        @Persisted var dateModified: Date = Date()
        @Persisted var title: String
        
        @Persisted var textData: TextData?
        @Persisted var urlData: URLData?
        @Persisted var objectData: ObjectData?
    
    // Some convenience methods / inits omitted
    }
    

    Version

    Realm 10.15.1

    What SDK flavour are you using?

    MongoDB Realm (i.e. Sync, auth, functions)

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    iOS 14.7.1

    Build environment

    Xcode version: 13.0

    T-Bug O-Community gathering-interest 
    opened by cmonsour 4
  • Module compiled with Swift 5.5 cannot be imported by the Swift 5.4 compiler

    Module compiled with Swift 5.5 cannot be imported by the Swift 5.4 compiler

    How frequently does the bug occur?

    All the time

    Description

    I am using the compiler Realm package 10.15.1 (https://github.com/realm/realm-cocoa/releases/download/v10.15.1/realm-swift-10.15.1.zip). I used the xcframework built on Xcode 13. I get the error "Module compiled with Swift 5.5 cannot be imported by the Swift 5.4 compiler" when I try to build the project with Xcode 12.5

    Stacktrace & log output

    Module compiled with Swift 5.5 cannot be imported by the Swift 5.4 compiler
    

    Can you reproduce the bug?

    Yes, always

    Reproduction Steps

    Use the xcframework for 13.0 (realm-swift-10.15.1/13.0)with Xcode 12.5.

    Version

    Realm 10.15.1

    What SDK flavour are you using?

    Local Database only

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    11.4 Mac OS

    Build environment

    Xcode version: 12.5

    T-Bug O-Community 
    opened by ravikirankhareedi 1
  • Crash on launch: Keychain returned unexpected status code: -25295

    Crash on launch: Keychain returned unexpected status code: -25295

    How frequently does the bug occur?

    Seen twice

    Description

    A user reported that my app is crashing on launch. I just launched a new version with MongoDB Realm Sync support. My app does have the keychain sharing entitlement enabled.

    Stacktrace & log output

    2021-09-13 17:20:12.993 Soulver 3[6599:275887] *** Terminating app due to uncaught exception 'RLMException', reason: 'Keychain returned unexpected status code: -25295'
    *** First throw call stack:
    (
    0   CoreFoundation                      0x00007fff2050483b __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff2023cd92 objc_exception_throw + 48
    2   Realm                               0x0000000105c42ae7 -[RLMApp initWithId:configuration:rootDirectory:] + 951
    3   Realm                               0x0000000105c42c78 +[RLMApp appWithId:configuration:rootDirectory:] + 158
    4   Realm                               0x0000000105c42d23 +[RLMApp appWithId:configuration:] + 20
    5   Realm                               0x0000000105c42d47 +[RLMApp appWithId:] + 19
    

    Can you reproduce the bug?

    Not yet

    Reproduction Steps

    No response

    Version

    10.13.0

    What SDK flavour are you using?

    MongoDB Realm (i.e. Sync, auth, functions)

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    macOS 11.5.2 (20G95)

    Build environment

    No response

    T-Bug O-Community 
    opened by zcohan 4
  • Crash after migrating schema AND library version

    Crash after migrating schema AND library version

    How frequently does the bug occur?

    Sometimes

    Description

    Hi Realm team!

    We have released a new version of the app and started receiving feedback from users reporting the app crashing after seen the splash screen for around 10 seconds.

    This is unfortunately a crash that we have never managed to reproduce.

    The data we have are:

    • the users' feedback, tens of them, who couldn't run the app after the update
    • some crash reports from App Store Connect > Analytics > Metric.

    The release that started this defect had 2 differences from the previous one:

    • a new schema version: we removed a field from a class. As far as I know, the library should handle the migration automatically
    • we updated the realm library from 3.21.0 to 10.14.0.

    After we noticed the crash, we released a new version of the app, replacing the migration block with the following:

    migration.deleteData(forType: "XXXModel")
    migration.deleteData(forType: "YYYModel")
    

    Unfortunately, this second new version didn't improve much the situation.

    Stacktrace & log output

    We had several stack traces pointing to Realm code for the crashes. I added in a zip file the top 3. You can find it at this link:
    
    https://drive.google.com/file/d/1xvTAYnTXCDhECfWkUAwxJNjlSFQ-W7Yb/view
    

    Can you reproduce the bug?

    Not yet

    Reproduction Steps

    N/A

    Version

    10.14.0

    What SDK flavour are you using?

    Local Database only

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    iOS 14.4, 14.6, 14.7, 15

    Build environment

    ProductName:	macOS
    ProductVersion:	12.0
    BuildVersion:	21A5506j
    
    /Applications/Xcode.app/Contents/Developer
    Xcode 12.5.1
    Build version 12E507
    
    /usr/local/bin/pod
    1.10.2
    Realm (10.14.0)
    RealmSwift (10.14.0)
    
    /bin/bash
    GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
    
    carthage not found
    (not in use here)
    
    /usr/bin/git
    git version 2.30.1 (Apple Git-130)
    
    T-Bug O-Community 
    opened by zebganzo 2
  • Unable to recover from RLMException  'Number of active versions...'

    Unable to recover from RLMException 'Number of active versions...'

    How frequently does the bug occur?

    All the time

    Description

    I'm using maximumNumberOfActiveVersions to debug unreleased Realms in my iOS app. Which led me to this problem: After exceeding the max number the app crashes, as expected. But when relaunching the app, it crashes again after only 1 write, and Xcode Memory Graph shows only 1 RLMRealm instance, as expected.

    My question: how to recover from this? I expected a relaunch would be enough to clean up active versions.

        static var playbackReporting: Realm.Configuration {
            var config = Realm.Configuration(
                fileURL: fileURL,
                deleteRealmIfMigrationNeeded: true,
                objectTypes: [PlaybackReportingDBClient.DBObjectType.self]
            )
            #if DEBUG
            config.maximumNumberOfActiveVersions = 24
            #else
            config.maximumNumberOfActiveVersions = 64
            #endif
            return config
        }
    
        private func realm() -> Realm { 
            do {
                return try Realm(configuration: configuration)
            } catch {
                fatalError("Could not init Realm, error: \(error)")
            }
        }
        private func write(object: Object) {
            autoreleasepool {
                do {
                    let realm = realm() // <- crashes here
                    try realm.write {
                        realm.add(object, update: .modified)
                    }
                } catch {
                    assertionFailure("Could not write to Realm, error: \(error)")
                }
            }
        }
    

    Stacktrace & log output

    2021-09-14 14:49:52.985276+0200 YouSee[76057:2796379] *** Terminating app due to uncaught exception 'RLMException', reason: 'Number of active versions (25) in the Realm exceeded the limit of 24'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x00007fff20422fba __exceptionPreprocess + 242
    	1   libobjc.A.dylib                     0x00007fff20193ff5 objc_exception_throw + 48
    	2   YouSee                              0x000000010de2c10f _Z18RLMSetErrorOrThrowP7NSErrorPU15__autoreleasingS0_ + 991
    	3   YouSee                              0x000000010ddb3b5b _Z26RLMRealmTranslateExceptionPU15__autoreleasingP7NSError + 715
    	4   YouSee                              0x000000010ddb7167 -[RLMRealm beginWriteTransactionWithError:] + 87
    	5   YouSee                              0x000000010ddb7108 -[RLMRealm beginWriteTransaction] + 40
    	6   YouSee                              0x000000010e920705 $s10RealmSwift0A0V10beginWriteyyF + 53
    	7   YouSee                              0x000000010e9203c4 $s10RealmSwift0A0V5write16withoutNotifying_xSaySo20RLMNotificationTokenCG_xyKXEtKlF + 212
    	8   YouSee                              0x000000010dae73af $s8DBClient11RealmClientC5write33_073067BEFA0861460837BC482605B6BELL6objectySo0B11SwiftObjectC_tFyyXEfU_ + 287
    	9   YouSee                              0x000000010dae70df $ss5Error_pIgzo_ytsAA_pIegrzo_TR + 15
    	10  YouSee                              0x000000010dae7c84 $ss5Error_pIgzo_ytsAA_pIegrzo_TRTA.12 + 20
    	11  libswiftObjectiveC.dylib            0x00007fff53f8903e $s10ObjectiveC15autoreleasepool8invokingxxyKXE_tKlF + 46
    	12  YouSee                              0x000000010dae5a9e $s8DBClient11RealmClientC5write33_073067BEFA0861460837BC482605B6BELL6objectySo0B11SwiftObjectC_tF + 190
    	13  YouSee                              0x000000010dae557f $s8DBClient11RealmClientC5writeyyxAA10DBStorableRzSERzlF + 271
    	14  YouSee                              0x000000010dae77b1 $s8DBClient11RealmClientCAA0A8ProtocolA2aDP5writeyyqd__KAA10DBStorableRd__SERd__lFTW + 17
    	15  YouSee                              0x000000010f34b311 $s17PlaybackReporting0aB8DBClientC5store6reportyAA0A6ReportV_tFyycfU_ + 225
    	16  YouSee                              0x000000010f34b600 $sIeg_IeyB_TR + 48
    	17  libdispatch.dylib                   0x0000000115266578 _dispatch_call_block_and_release + 12
    	18  libdispatch.dylib                   0x000000011526774e _dispatch_client_callout + 8
    	19  libdispatch.dylib                   0x0000000115275b3f _dispatch_main_queue_callback_4CF + 1152
    	20  CoreFoundation                      0x00007fff203908f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    	21  CoreFoundation                      0x00007fff2038b169 __CFRunLoopRun + 2781
    	22  CoreFoundation                      0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
    	23  GraphicsServices                    0x00007fff2b874d85 GSEventRunModal + 139
    	24  UIKitCore                           0x00007fff246c14df -[UIApplication _run] + 912
    	25  UIKitCore                           0x00007fff246c639c UIApplicationMain + 101
    	26  YouSee                              0x000000010d457cfb main + 75
    	27  libdyld.dylib                       0x00007fff2025abbd start + 1
    	28  ???                                 0x000000000000000a 0x0 + 10
    )
    libc++abi: terminating with uncaught exception of type NSException
    *** Terminating app due to uncaught exception 'RLMException', reason: 'Number of active versions (25) in the Realm exceeded the limit of 24'
    terminating with uncaught exception of type NSException
    CoreSimulator 776.1 - Device: iPhone 12 (D8D1CC1D-837B-4E61-8E3E-50796D0BFB9D) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12
    

    Can you reproduce the bug?

    Yes, always

    Reproduction Steps

    1. reach max number of active versions
    2. relaunch app
    3. make 1 write -> app crashes again

    Version

    10.14.0

    What SDK flavour are you using?

    Local Database only

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    iOS 14.5

    Build environment

    Xcode version: 12.5.1 (12E507) Dependency manager and version: SPM

    T-Bug O-Community 
    opened by timstudt 3
  • Can't set object of type 'Skin' to property of type 'Skin'

    Can't set object of type 'Skin' to property of type 'Skin'

    How frequently does the bug occur?

    Seen once

    Description

    I have some realm model which has another realm object as a property and i am getting the crash report from firebase , when i am trying to set the value of that property , with this error message "Can't set object of type 'Skin' to property of type 'Skin'"

    Stacktrace & log output

    No response

    Can you reproduce the bug?

    Not yet

    Reproduction Steps

    No response

    Version

    10.7.2

    What SDK flavour are you using?

    Local Database only

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    iOS 14.7.1

    Build environment

    Xcode version: ... Dependency manager and version: ...

    T-Bug O-Community 
    opened by HovhannesPoghosyan 2
Releases(v10.15.1)
  • v10.15.1(Sep 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.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(284.10 MB)
    Carthage.xcframework.zip(240.65 MB)
    realm-objc-10.15.1.zip(456.60 MB)
    realm-swift-10.15.1.zip(979.78 MB)
  • v10.15.0(Sep 10, 2021)

    Enhancements

    • Add async versions of the Realm.asyncOpen and App.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)

    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 referred to indices 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)

    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
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(288.09 MB)
    Carthage.xcframework.zip(239.86 MB)
    realm-objc-10.15.0.zip(456.59 MB)
    realm-swift-10.15.0.zip(979.29 MB)
  • v10.14.0(Sep 3, 2021)

    Enhancements

    • Add additional observe methods for Objects and RealmCollections which take a PartialKeyPath 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 to Codable. (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.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(290.92 MB)
    Carthage.xcframework.zip(239.84 MB)
    realm-objc-10.14.0.zip(459.02 MB)
    realm-swift-10.14.0.zip(979.04 MB)
  • v10.13.0(Aug 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
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(290.12 MB)
    Carthage.xcframework.zip(239.06 MB)
    realm-objc-10.13.0.zip(458.84 MB)
    realm-swift-10.13.0.zip(731.23 MB)
  • v10.12.0(Aug 3, 2021)

    Enhancements

    • Object.observe() and RealmCollection.observe() now include an optional keyPaths 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 optional keyPaths 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 to AsyncOpen, 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 wrappers AsyncOpen and AutoOpen: 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 a DecodingError.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
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(289.88 MB)
    Carthage.xcframework.zip(238.73 MB)
    realm-objc-10.12.0.zip(458.37 MB)
    realm-swift-10.12.0.zip(730.23 MB)
  • v10.11.0(Jul 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 a null json value. (Cocoa #7323, since v10.8.0)
    • @Persisted<T?> would crash when decoding a null value. (#7332, since v10.10.0).
    • 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
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(288.49 MB)
    Carthage.xcframework.zip(237.58 MB)
    realm-objc-10.11.0.zip(458.65 MB)
    realm-swift-10.11.0.zip(726.89 MB)
  • v10.10.0(Jul 7, 2021)

    Enhancements

    • Add a new property wrapper-based declaration syntax for properties on Realm Swift object classes. Rather than using @objc dynamic or the RealmProperty wrapper type, properties can now be declared with @Persisted var property: T, where T 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 requires let, and the RealmProperty or RealmOptional helper is no longer needed for types not supported by Objective-C.

      • No more overriding class methods like primaryKey(), indexedProperties() or ignoredProperties(). 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 the List<T> object being created eagerly when the parent object is read, which could cause performance problems if a class has a large number of List or RealmOptional properties. @Persisted var list: List<T> allows us to defer creating the List<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 the PersistableEnum protocol, and still cannot (yet) be used in collections.

      • willSet and didSet can be used with @Persistable properties, while they previously did not work on managed Realm objects.

      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 of RLMDictionary/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.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(286.13 MB)
    Carthage.xcframework.zip(235.58 MB)
    realm-objc-10.10.0.zip(461.04 MB)
    realm-swift-10.10.0.zip(962.20 MB)
  • v10.9.0(Jul 1, 2021)

    Enhancements

    • Add App.emailPasswordAuth.retryCustomConfirmation(email:completion:) and [App.emailPasswordAuth retryCustomConfirmation:completion:]. These functions support retrying a custom confirmation function.
    • Improve performance of many Dictionary operations, especially when KVO is being used.

    Fixed

    • Calling -[RLMRealm deleteObjects:] on a RLMDictionary cleared the dictionary but did not actually delete the objects in the dictionary (since v10.8.0).
    • Fix an assertion failure when observing a List<AnyRealmValue> containing object links. (Core #4767, since v10.8.0)
    • Fix an assertion failure when observing a RLMDictionary/Map which links to an object which was deleting by a different sync client. (Core #4770, since v10.8.0)
    • Fix an endless recursive loop that could cause a stack overflow when computing changes on a set of objects which contained cycles. (Core #4770, since v10.8.0).
    • Hash collisions in dictionaries were not handled properly. (Core #4776, since v10.8.0).
    • Fix a crash after clearing a list or set of AnyRealmValue containing links to objects (Core #4774, since v10.8.0)
    • Trying to refresh a user token which had been revoked by an admin lead to an infinite loop and then a crash. This situation now properly logs the user out and reports an error. (Core #4745, 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 2.

    Internal

    • Upgraded realm-core from v11.0.3 to v11.0.4
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(281.77 MB)
    Carthage.xcframework.zip(231.63 MB)
    realm-objc-10.9.0.zip(460.37 MB)
    realm-swift-10.9.0.zip(946.23 MB)
  • v10.8.1(Jun 22, 2021)

    Enhancements

    • Update Xcode 12.5 to Xcode 12.5.1.
    • Create fewer dynamic classes at runtime, improving memory usage and startup time slightly.

    Fixed

    • Importing the Realm swift package produced several warnings about excluded files not existing. Note that one warning will still remain after this change. (#7295, since v10.8.0).
    • Update the root URL for the API docs so that the links go to the place where new versions of the docs are being published. (#7299, since v10.6.0).

    Compatibility

    • Realm Studio: 11.0.0 or later. Note that this version of Realm Studio has not yet been released at the time of this release.
    • 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 1.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(281.73 MB)
    Carthage.xcframework.zip(231.36 MB)
    realm-objc-10.8.1.zip(459.84 MB)
    realm-swift-10.8.1.zip(945.02 MB)
  • v10.8.0(Jun 14, 2021)

    NOTE: This version upgrades the Realm file format version to add support for the new data types and to adjust how primary keys are handled. Realm files opened will be automatically upgraded and cannot be read by versions older than v10.8.0. This upgrade should be a fairly fast one. Note that we now automatically create a backup of the pre-upgrade Realm.

    Enhancements

    • Add support for the UUID and NSUUID data types. These types can be used for the primary key property of Object classes.
    • Add two new collection types to complement the existing RLMArray/List type:
      • RLMSet<T> in Objective-C and MutableSet<T> in Swift are mutable unordered collections of distinct objects, similar to the built-in NSMutableSet and Set. The values in a set may be any non-collection type which can be stored as a Realm property. Sets are guaranteed to never contain two objects which compare equal to each other, including when conflicting writes are merged by sync.
      • RLMDictionary<NSString *, T> in Objective-C and Map<String, T> are mutable key-value dictionaries, similar to the built-in NSMutableDictionary and Dictionary. The values in a dictionary may be any non-collection type which can be stored as a Realm property. The keys must currently always be a string.
    • Add support for dynamically typed properties which can store a value of any of the non-collection types supported by Realm, including Object subclasses (but not EmbeddedObject subclasses). These are declared with @property id<RLMValue> propertyName; in Objective-C and let propertyName = RealmProperty<AnyRealmValue>() in Swift.

    Fixed

    • Setting a collection with a nullable value type to null via one of the dynamic interfaces would hit an assertion failure instead of clearing the collection.
    • Fixed an incorrect detection of multiple incoming links in a migration when changing a table to embedded and removing a link to it at the same time. (#4694 since v10.0.0-beta.2)
    • Fixed a divergent merge on Set when one client clears the Set and another client inserts and deletes objects. (#4720)
    • Partially revert to pre-v5.0.0 handling of primary keys to fix a performance regression. v5.0.0 made primary keys determine the position in the low-level table where newly added objects would be inserted, which eliminated the need for a separate index on the primary key. This made some use patterns slightly faster, but also made some reasonable things dramatically slower. (#4522)
    • Fixed an incorrect detection of multiple incoming links in a migration when changing a table to embedded and removing a link to it at the same time. (#4694 since v10.0.0-beta.2)
    • Fix collection notification reporting for modifications. This could be observed by receiving the wrong indices of modifications on sorted or distinct results, or notification blocks sometimes not being called when only modifications have occured. (#4573 since v5.0.0).
    • Fix incorrect sync instruction emission when replacing an existing embedded object with another embedded object.(Core #4740

    Deprecations

    • RealmOptional<T> has been deprecated in favor of RealmProperty<T?>. RealmProperty is functionality identical to RealmOptional when storing optional numeric types, but can also store the new AnyRealmValue type.

    Compatibility

    • Realm Studio: 11.0.0 or later. Note that this version of Realm Studio has not yet been released at the time of this release.
    • Carthage release for Swift is built with Xcode 12.5.
    • CocoaPods: 1.10 or later.
    • Xcode: 12.2-13.0 beta 1.

    Internal

    • Upgraded realm-core from v10.7.2 to v11.0.3
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(281.64 MB)
    Carthage.xcframework.zip(231.30 MB)
    realm-objc-10.8.0.zip(459.78 MB)
    realm-swift-10.8.0.zip(944.87 MB)
  • v10.7.7(Jun 10, 2021)

    Xcode 12.2 is now the minimum supported version.

    Enhancements

    • Add Xcode 13 beta 1 binaries to the release package.

    Fixed

    • Fix a runtime crash which happens in some Xcode version (Xcode < 12, reported in Xcode 12.5), where SwiftUI is not weak linked by default. This fix only works for Cocoapods projects. (#7234
    • Fix warnings when building with Xcode 13 beta 1.

    Compatibility

    • Realm Studio: 10.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.
    • CocoaPods: 1.10 or later.
    • Xcode: 12.2-13.0 beta 1.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(239.32 MB)
    Carthage.xcframework.zip(202.41 MB)
    realm-objc-10.7.7.zip(398.19 MB)
    realm-swift-10.7.7.zip(829.74 MB)
  • v10.8.0-beta.2(Jun 1, 2021)

    Enhancements

    • Add RLMDictionary/Map<> datatype. This is a Dictionary collection type used for storing key-value pairs in a collection.

    Compatibility

    • Realm Studio: 11.0.0-beta.1 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.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v11.0.0-beta.4 to v11.0.0-beta.6
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(281.44 MB)
    Carthage.xcframework.zip(231.73 MB)
    realm-objc-10.8.0-beta.2.zip(460.59 MB)
    realm-swift-10.8.0-beta.2.zip(1014.04 MB)
  • v10.7.6(May 13, 2021)

    Enhancements

    • Realms opened in read-only mode can now be invalidated (although it is unlikely to be useful to do so).
    • Thread-safe references can now be created for read-only Realms. (#5475).

    Fixed

    • Fix an availability warning when building Realm. The code path which gave the warning can not currently be hit, so this did not cause any runtime problems (#7219, since 10.7.3).
    • Proactively check the expiry time on the access token and refresh it before attempting to initiate a sync session. This prevents some error logs from appearing on the client such as: "ERROR: Connection[1]: Websocket: Expected HTTP response 101 Switching Protocols, but received: HTTP/1.1 401 Unauthorized" (RCORE-473, since v10.0.0)
    • Fix a race condition which could result in a skipping notifications failing to skip if several commits using notification skipping were made in succession (since v5.0.0).
    • Fix a crash on exit inside TableRecycler which could happen if Realms were open on background threads when the app exited. (Core #4600, since v5.0.0)
    • Fix errors related to "uncaught exception in notifier thread: N5realm11KeyNotFoundE: No such object" which could happen on synchronized Realms if a linked object was deleted by another client. (JS #3611, since v10.0.0).
    • Reading a link to an object which has been deleted by a different client via a string-based interface (such as value(forKey:) or the subscript operator on DynamicObject) could return an invalid object rather than nil. (Core #4687, since v10.0.0)
    • Recreate the sync metadata Realm if the encryption key for it is missing from the keychain rather than crashing. This can happen if a device is restored from an unencrypted backup, which restores app data but not the app's keychain entries, and results in all cached logics for sync users being discarded but no data being lost. Core #4285

    Compatibility

    • Realm Studio: 10.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.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.6.0 to v10.7.2
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(239.16 MB)
    Carthage.xcframework.zip(202.30 MB)
    realm-objc-10.7.6.zip(398.19 MB)
    realm-swift-10.7.6.zip(886.79 MB)
  • v10.7.5(May 7, 2021)

    Fixed

    • Iterating over frozen collections on multiple threads at the same time could throw a "count underflow" InternalInconsistencyException. (#7237, since v5.0.0).

    Compatibility

    • Realm Studio: 10.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.
    • CocoaPods: 1.10 or later.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(239.03 MB)
    Carthage.xcframework.zip(201.99 MB)
    realm-objc-10.7.5.zip(397.65 MB)
    realm-swift-10.7.5.zip(885.42 MB)
  • v5.5.2(May 3, 2021)

  • v10.7.4(Apr 26, 2021)

    Enhancements

    • Add Xcode 12.5 binaries to the release package.

    Fixed

    • Add the Info.plist file to the XCFrameworks in the Carthage xcframework package (#7216, since 10.7.3).

    Compatibility

    • Realm Studio: 10.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.
    • CocoaPods: 1.10 or later.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(239.00 MB)
    Carthage.xcframework.zip(218.77 MB)
    realm-objc-10.7.4.zip(397.63 MB)
    realm-swift-10.7.4.zip(902.18 MB)
  • v10.7.3(Apr 22, 2021)

    Enhancements

    • Package a prebuilt XCFramework for Carthage. Carthage 0.38 and later will download this instead of the old frameworks when using --use-xcframeworks.
    • We now make a backup of the realm file prior to any file format upgrade. The backup is retained for 3 months. Backups from before a file format upgrade allows for better analysis of any upgrade failure. We also restore a backup, if a) an attempt is made to open a realm file whith a "future" file format and b) a backup file exist that fits the current file format. (Core #4166)
    • The error message when the intial steps of opening a Realm file fails is now more descriptive.
    • Make conversion of Decimal128 to/from string work for numbers with more than 19 significant digits. This means that Decimal128's initializer which takes a string will now never throw, as it previously threw only for out-of-bounds values. The initializer is still marked as throws for backwards compatibility. (#4548)

    Fixed

    • Adjust the header paths for the podspec to avoid accidentally finding a file which isn't part of the pod that produced warnings when importing the framework. (#7113, since 10.5.2).
    • Fixed a crash that would occur when observing unmanaged Objects in multiple views in SwiftUI. When using @StateRealmObject or @ObservedObject across multiple views with an unmanaged object, each view would subscribe to the object. As each view unsubscribed (generally when trailing back through the view stack), our propertyWrappers would attempt to remove the KVOs for each cancellation, when it should only be done once. We now correctly remove KVOs only once. (#7131)
    • Fixed isInvalidated not returning correct value after object deletion from Realm when using a custom schema. The object's Object Schema was not updated when the object was added to the realm. We now correctly update the object schema when adding it to the realm. (#7181)
    • Syncing large Decimal128 values would cause "Assertion failed: cx.w[1] == 0" (Core #4519, since v10.0.0).
    • Potential/unconfirmed fix for crashes associated with failure to memory map (low on memory, low on virtual address space). For example (#4514, since v5.0.0).
    • Fix assertion failures such as "!m_notifier_skip_version.version" or "m_notifier_sg->get_version() + 1 == new_version.version" when performing writes inside change notification callbacks. Previously refreshing the Realm by beginning a write transaction would skip delivering notifications, leaving things in an inconsistent state. Notifications are now delivered recursively when needed instead. (Cocoa #7165).
    • Fix collection notification reporting for modifications. This could be observed by receiving the wrong indices of modifications on sorted or distinct results, or notification blocks sometimes not being called when only modifications have occurred. (#4573 since v5.0.0).

    Compatibility

    • Realm Studio: 10.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.4.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.5.5 to v10.6.0
    • Add additional debug validation to file map management that will hopefully catch cases where we unmap something which is still in use.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(238.99 MB)
    Carthage.xcframework.zip(201.45 MB)
    realm-objc-10.7.3.zip(273.50 MB)
    realm-swift-10.7.3.zip(875.45 MB)
  • v5.5.1(Mar 18, 2021)

    Fixed

    • During integration of a large amount of data from the server, you may get "Assertion failed: !fields.has_missing_parent_update()" (Core #4497, since v5.0.0)
    • Queries of the form "a.b.c == nil" would match objects where b is nil if c did not have an index and did not if c was indexed. Both will now match to align with NSPredicate's behavior. ([Core #4460]https://github.com/realm/realm-core/pull/4460), since 4.3.0).
    • Restore support for upgrading files from file format 5 (Realm Cocoa 1.x). (Core #7089, since v5.0.0)
    • On 32bit devices you may get exception with "No such object" when upgrading to v10.* (Java #7314, since v5.0.0)
    • Fix "Invalid ref translation entry [16045690984833335023, 78187493520]" assertion failure which could occur when using sync or multiple processes writing to a single Realm file. (#7086, since v5.0.0).
    • Restore support for upgrading files from file format 5 (Realm Cocoa 1.x). (Core #7089, since v5.0.0)
    • Fixed an issue where creating an object after file format upgrade may fail with assertion "Assertion failed: lo() <= std::numeric_limits<uint32_t>::max()" (#4295, since v5.0.0)
    • Fast-enumerating a List after deleting the parent object would crash with an assertion failure rather than a more appropriate exception. (Core #4114, since v5.0.0).
    • Fix a race condition which could potentially allow queries on frozen Realms to access an uninitialized structure for search indexes (since v5.0.0).
    • Fix crash in case insensitive query on indexed string columns when nothing matches (#6836, since v5.0.0).
    • Null values in a List<Float?> or List<Double?> were incorrectly treated as non-null in some places. It is unknown if this caused any functional problems when using the public API. (Core PR #3987, since v5.0.0).
    • Limit availability of ObjectKeyIdentifiable to platforms which support Combine to match the change made in the Xcode 12.5 SDK. (#7083)

    Compatibility

    • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
    • Realm Object Server: 3.21.0 or later.
    • Realm Studio: 5.0.0 or later.
    • APIs are backwards compatible with all previous releases in the 5.x.y series.
    • Carthage release for Swift is built with Xcode 12.4.

    Internal

    • Upgraded realm-core from v6.1.4 to v6.2.4
    • Upgraded realm-sync from v5.0.29 to v5.0.33
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(243.42 MB)
    realm-objc-5.5.1.zip(326.87 MB)
    realm-swift-5.5.1.zip(356.31 MB)
  • v10.7.2(Mar 8, 2021)

    Fixed

    • During integration of a large amount of data from the server, you may get "Assertion failed: !fields.has_missing_parent_update()" (Core #4497, since v6.0.0)

    Compatibility

    • Realm Studio: 10.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.4.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.5.4 to v10.5.5
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(237.51 MB)
    Carthage.xcframework.zip(232.79 MB)
    realm-objc-10.7.2.zip(270.56 MB)
    realm-swift-10.7.2.zip(870.79 MB)
  • v10.7.1(Mar 5, 2021)

    Fixed

    • Queries of the form "a.b.c == nil" would match objects where b is nil if c did not have an index and did not if c was indexed. Both will now match to align with NSPredicate's behavior. (Core #4460, since 4.3.0).
    • Restore support for upgrading files from file format 5 (Realm Cocoa 1.x). (Core #7089, since v5.0.0)
    • On 32bit devices you may get exception with "No such object" when upgrading to v10.* (Java #7314, since v5.0.0)
    • The notification worker thread would rerun queries after every commit rather than only commits which modified tables which could effect the query results if the table had any outgoing links to tables not used in the query. (Core #4456, since v5.0.0).
    • Fix "Invalid ref translation entry [16045690984833335023, 78187493520]" assertion failure which could occur when using sync or multiple processes writing to a single Realm file. (#7086, since v5.0.0).

    Compatibility

    • Realm Studio: 10.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.4.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.5.3 to v10.5.4
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(237.50 MB)
    realm-objc-10.7.1.zip(270.47 MB)
    realm-swift-10.7.1.zip(870.82 MB)
  • v10.7.0(Feb 23, 2021)

    Enhancements

    • Add support for some missing query operations on data properties:
      • Data properties can be compared to other data properties (e.g. "dataProperty1 == dataProperty2").
      • Case and diacritic-insensitive queries can be performed on data properties. This will only have meaningful results if the data property contains UTF-8 string data.
      • Data properties on linked objects can be queried (e.g. "link.dataProperty CONTAINS %@")
    • Implement queries which filter on lists other than object links (lists of objects were already supported). All supported operators for normal properties are now supported for lists (e.g. "ANY intList = 5" or "ANY stringList BEGINSWITH 'prefix'"), as well as aggregate operations on the lists (such as "[email protected] > 100").
    • Performance of sorting on more than one property has been improved. Especially important if many elements match on the first property. Mitigates (#7092)

    Fixed

    • Fixed a bug that prevented an object type with incoming links from being marked as embedded during migrations. (Core #4414)
    • The Realm notification listener thread could sometimes hit the assertion failure "!skip_version.version" if a write transaction was committed at a very specific time (since v10.5.0).
    • Added workaround for a case where upgrading an old file with illegal string would crash (#7111).
    • Fixed a conflict resolution bug related to the ArrayMove instruction, which could sometimes cause an "Invalid prior_size" exception to prevent synchronization (since v10.5.0).
    • Skipping a change notification in the first write transaction after the observer was added could potentially fail to skip the notification (since v10.5.1).

    Compatibility

    • Realm Studio: 10.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.4.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.5.0 to v10.5.3
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(237.53 MB)
    realm-objc-10.7.0.zip(270.43 MB)
    realm-swift-10.7.0.zip(870.67 MB)
  • v10.6.0(Feb 15, 2021)

    Enhancements

    • Add @StateRealmObject for SwiftUI support. This property wrapper type instantiates an observable object on a View. Use in place of SwiftUI.StateObject for Realm Object, List, and EmbeddedObject types.
    • Add @ObservedRealmObject for SwiftUI support. This property wrapper type subscribes to an observable object and invalidates a view whenever the observable object changes. Use in place of SwiftUI.ObservedObject for Realm Object, List, or EmbeddedObject types.
    • Add @ObservedResults for SwiftUI support. This property wrapper type retrieves results from a Realm. The results use the realm configuration provided by the environment value EnvironmentValues.realmConfiguration.
    • Add EnvironmentValues.realm and EnvironmentValues.realmConfiguration for Realm and Realm.Configuration types respectively. Values can be injected into views using the View.environment method, e.g., MyView().environment(.realmConfiguration, Realm.Configuration(fileURL: URL(fileURLWithPath: "myRealmPath.realm"))). The value can then be declared on the exampleMyViewas@Environment(.realm) var realm`.
    • Add SwiftUI.Binding extensions where Value is of type Object, List, or EmbeddedObject. These extensions expose methods for wrapped write transactions, to avoid boilerplate within views, e.g., TextField("name", $personObject.name) or $personList.append(Person()).
    • Add Object.bind and EmbeddedObject.bind for SwiftUI support. This allows you to create bindings of realm properties when a propertyWrapper is not available for you to do so, e.g., TextField("name", personObject.bind(\.name)).
    • The Sync client now logs error messages received from server rather than just the size of the error message.
    • Errors returned from the server when sync WebSockets get closed are now captured and surfaced as a SyncError.
    • Improve performance of sequential reads on a Results backed directly by a Table (i.e. realm.object(ClasSName.self) with no filter/sort/etc.) by 50x.
    • Orphaned embedded object types which are not linked to by any top-level types are now better handled. Previously the server would reject the schema, resulting in delayed and confusing error reporting. Explicitly including an orphan in objectTypes is now immediately reported as an error when opening the Realm, and orphans are automatically excluded from the auto-discovered schema when objectTypes is not specified.

    Fixed

    • Reading from a Results backed directly by a Table (i.e. realm.object(ClasSName.self) with no filter/sort/etc.) would give incorrect results if the Results was constructed and accessed before creating a new object with a primary key less than the smallest primary key which previously existed. (#7014, since v5.0.0).
    • During synchronization you might experience crash with "Assertion failed: ref + size <= next->first". (Core #4388)

    Compatibility

    • Realm Studio: 10.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.4.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.4.0 to v10.5.0
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(235.23 MB)
    realm-objc-10.6.0.zip(269.79 MB)
    realm-swift-10.6.0.zip(916.90 MB)
  • v10.5.2(Feb 9, 2021)

    Enhancements

    • Add support for "thawing" objects. Realm, Results, List and Object now have thaw() methods which return a live copy of the frozen object. This enables app behvaior where a frozen object can be made live again in order to mutate values. For example, first freezing an object passed into UI view, then thawing the object in the view to update values.
    • Add Xcode 12.4 binaries to the release package.

    Fixed

    • Inserting a date into a synced collection via AnyBSON.datetime(...) would be of type Timestamp and not Date. This could break synced objects with a Date property (#6654, since v10.0.0).
    • Fixed an issue where creating an object after file format upgrade may fail with assertion "Assertion failed: lo() <= std::numeric_limits<uint32_t>::max()" (#4295, since v5.0.0)
    • Allow enumerating objects of types which are no longer present in the schema.
    • Add RLMResponse.customStatusCode. This fixes timeout exceptions that were occuring with a poor connection. (#4188)
    • Fix - RLMResponse will have a non nil customStatusCode in case of error. (#4188)
    • Limit availability of ObjectKeyIdentifiable to platforms which support Combine to match the change made in the Xcode 12.5 SDK. #7083)

    Compatibility

    • Realm Studio: 10.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.4.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.3.3 to v10.4.0
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(231.65 MB)
    realm-objc-10.5.2.zip(267.44 MB)
    realm-swift-10.5.2.zip(903.39 MB)
  • v10.5.1(Jan 15, 2021)

    Enhancements

    • Add Xcode 12.3 binary to release package.
    • Add support for queries which have nil on the left side and a keypath on the right side (e.g. "nil == name" rather than "name == nil" as was previously required).

    Fixed

    • Timeouts when calling server functions via App would sometimes crash rather than report an error.
    • Fix a race condition which would lead to "uncaught exception in notifier thread: N5realm15InvalidTableRefE: transaction_ended" and a crash when the source Realm was closed or invalidated at a very specific time during the first run of a collection notifier (#3761, since v5.0.0).
    • Deleting and recreating objects with embedded objects may fail. (Core PR #4240, since v10.0.0)
    • Fast-enumerating a List after deleting the parent object would crash with an assertion failure rather than a more appropriate exception. (Core #4114, since v5.0.0).

    Compatibility

    • Realm Studio: 10.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.3.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.3.2 to v10.3.3
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(227.20 MB)
    realm-objc-10.5.1.zip(262.52 MB)
    realm-swift-10.5.1.zip(1014.33 MB)
  • v10.5.0(Dec 14, 2020)

    Enhancements

    • MongoDB Realm is now supported when installing Realm via Swift Package Manager.

    Fixed

    • The user identifier was added to the file path for synchronized Realms twice and an extra level of escaping was performed on the partition value. This did not cause functional problems, but made file names more confusing than they needed to be. Existing Realm files will continue to be located at the old path, while newly created files will be created at a shorter path. (Since v10.0.0).
    • Fix a race condition which could potentially allow queries on frozen Realms to access an uninitialized structure for search indexes (since v5.0.0).
    • Fix several data races in App and SyncSession initialization. These could possibly have caused strange errors the first time a synchronized Realm was opened (since v10.0.0).
    • Fix a use of a dangling reference when refreshing a user’s custom data that could lead to a crash (since v10.0.0).

    Compatibility

    • Realm Studio: 10.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.2.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.1.4 to v10.3.2
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(229.43 MB)
    realm-objc-10.5.0.zip(264.63 MB)
    realm-swift-10.5.0.zip(1014.74 MB)
  • v10.4.0(Dec 10, 2020)

    Enhancements

    • Add Combine support for App and User. These two types now have a objectWillChange property that emits each time the state of the object has changed (such as due to the user logging in or out). (PR #6977).

    Fixed

    • Integrating changsets from the server would sometimes hit the assertion failure "n != realm::npos" inside Table::create_object_with_primary_key() when creating an object with a primary key which previously had been used and had incoming links. (Core PR #4180, since v10.0.0).
    • The arm64 simulator slices were not actually included in the XCFramework release package. (PR #6982, since v10.2.0).

    Compatibility

    • Realm Studio: 10.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.2.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-core from v10.1.3 to v10.1.4
    • Upgraded realm-sync from v10.1.4 to v10.1.5
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(340.19 MB)
    realm-objc-10.4.0.zip(405.97 MB)
    realm-swift-10.4.0.zip(1101.32 MB)
  • v10.3.0(Dec 8, 2020)

    Enhancements

    • Add Google OpenID Connect Credentials, an alternative login credential to the Google OAuth 2.0 credential.

    Fixed

    • Fixed a bug that would prevent eventual consistency during conflict resolution. Affected clients would experience data divergence and potentially consistency errors as a result if they experienced conflict resolution between cycles of Create-Erase-Create for objects with primary keys (since v10.0.0).

    Compatibility

    • Realm Studio: 10.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.2.
    • CocoaPods: 1.10 or later.

    Internal

    • Upgraded realm-sync from v10.1.3 to v10.1.4
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(334.62 MB)
    realm-objc-10.3.0.zip(401.12 MB)
    realm-swift-10.3.0.zip(895.81 MB)
  • v10.2.0(Dec 2, 2020)

    Enhancements

    • The prebuilt binaries are now packaged as XCFrameworks. This adds support for Catalyst and arm64 simulators when using them to install Realm, removes the need for the strip-frameworks build step, and should simplify installation.
    • The support functionality for using the Objective C API from Swift is now included in Realm Swift and now includes all of the required wrappers for MongoDB Realm types. In mixed Objective C/Swift projects, we recommend continuing to use the Objective C types, but import both Realm and RealmSwift in your Swift files.

    Fixed

    • The user identifier was added to the file path for synchronized Realms twice and an extra level of escaping was performed on the partition value. This did not cause functional problems, but made file names more confusing than they needed to be. Existing Realm files will continue to be located at the old path, while newly created files will be created at a shorter path. (Since v10.0.0).

    Compatibility

    • Realm Studio: 10.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.2.
    • CocoaPods: 1.10 or later.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(331.66 MB)
    realm-objc-10.2.0.zip(397.48 MB)
    realm-swift-10.2.0.zip(879.86 MB)
  • v10.1.4(Nov 16, 2020)

  • v10.1.3(Nov 13, 2020)

    Enhancements

    • Add Xcode 12.2 binaries to the release package.

    Fixed

    • Disallow setting RLMRealmConfiguration.deleteRealmIfMigrationNeeded/Realm.Config.deleteRealmIfMigrationNeeded when sync is enabled. This did not actually work as it does not delete the relevant server state and broke in confusing ways (PR #6931).

    Compatibility

    • Realm Studio: 10.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.1.
    • CocoaPods: 1.10 or later.
    Source code(tar.gz)
    Source code(zip)
    Carthage.framework.zip(311.05 MB)
    realm-objc-10.1.3.zip(397.55 MB)
    realm-swift-10.1.3.zip(878.21 MB)
Owner
Realm
Realm is a mobile database: a replacement for SQLite & ORMs. SDKs for Swift, Objective-C, Java, Kotlin, C#, and JavaScript.
Realm
A type-safe, Swift-language layer over SQLite3.

SQLite.swift A type-safe, Swift-language layer over SQLite3. SQLite.swift provides compile-time confidence in SQL statement syntax and intent. Feature

Stephen Celis 7.8k Sep 16, 2021
A Cocoa / Objective-C wrapper around SQLite

FMDB v2.7 This is an Objective-C wrapper around SQLite. The FMDB Mailing List: https://groups.google.com/group/fmdb Read the SQLite FAQ: https://www.s

August 13.6k Sep 21, 2021
Official home of the DB Browser for SQLite (DB4S) project. Previously known as "SQLite Database Browser" and "Database Browser for SQLite". Website at:

DB Browser for SQLite What it is DB Browser for SQLite (DB4S) is a high quality, visual, open source tool to create, design, and edit database files c

null 15.4k Sep 24, 2021
Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.

Unrealm enables you to easily store Swift native Classes, Structs and Enums into Realm . Stop inheriting from Object! Go for Protocol-Oriented program

Artur  Mkrtchyan 459 Sep 14, 2021
A library that provides the ability to import/export Realm files from a variety of data container formats.

Realm Converter Realm Converter is an open source software utility framework to make it easier to get data both in and out of Realm. It has been built

Realm 204 Jul 28, 2021
Sync Realm Database with CloudKit

IceCream helps you sync Realm Database with CloudKit. It works like magic! Features Realm Database Off-line First Thread Safety Reactive Programming O

Soledad 1.6k Sep 18, 2021
WCDB is a cross-platform database framework developed by WeChat.

WCDB 中文版本请参看这里 WCDB is an efficient, complete, easy-to-use mobile database framework used in the WeChat application. It's currently available on iOS,

Tencent 9.2k Sep 16, 2021
Mac Native Mongodb Client

System Requirements Mac OS X (10.8.x, 10.9.x, 10.10.x), intel 64bit based. Download HERE Or you can compile it yourself using Xcode Build Just build i

Jérôme Lebel 2.5k Sep 12, 2021
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers.

YapDatabase is a collection/key/value store and so much more. It's built atop sqlite, for Swift & Objective-C developers, targeting macOS, iOS, tvOS &

Yap Studios 3.3k Sep 14, 2021
CoreData/Realm sweet wrapper written in Swift

What is SugarRecord? SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData in a much easier way. Than

Modo 2.1k Aug 18, 2021
Free universal database tool and SQL client

DBeaver Free multi-platform database tool for developers, SQL programmers, database administrators and analysts. Supports any database which has JDBC

DBeaver 22.2k Sep 16, 2021
Native MongoDB driver for Swift, written in Swift

Installation | Tutorial | Basic usage | About BSON | Codable | Community | How to help A fast, pure swift MongoDB driver based on Swift NIO built for

null 617 Sep 20, 2021
Personal db information management system.

The Information Management System This tool is so simple that most people don't understand how to use it. TL;DR This is a personal database which stor

null 39 Sep 14, 2021
MySQL/MariaDB database management for macOS

Sequel Ace Sequel Ace is the "sequel" to longtime macOS tool Sequel Pro. Sequel Ace is a fast, easy-to-use Mac database management application for wor

Sequel-Ace 3.6k Sep 18, 2021
Native cross-platform MongoDB management tool

About Robo 3T Robo 3T (formerly Robomongo *) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robo

Studio 3T 8.7k Sep 23, 2021
The easiest way to get started with PostgreSQL on the Mac

Postgres.app The easiest way to run PostgreSQL on your Mac Includes everything you need to get started with PostgreSQL Comes with a pretty GUI to star

Postgres.app 6k Sep 23, 2021
MySQL/MariaDB database management for macOS

Sequel Pro Sequel Pro is a fast, easy-to-use Mac database management application for working with MySQL & MariaDB databases. You can find more details

Sequel Pro 8.5k Sep 19, 2021
:wrench: Cross-platform GUI management tool for Redis

RDM Install & Run | Quick Start | Native Formatters | Development Guide | Known issues | Telegram Chat Open source cross-platform Desktop Manager for

Igor Malinovskiy 19k Sep 24, 2021
💻 Medis is a beautiful, easy-to-use Mac database management application for Redis.

Medis Medis is a beautiful, easy-to-use Redis management application built on the modern web with Electron, React, and Redux. It's powered by many awe

Zihua Li 10.4k Sep 14, 2021