diff --git a/Realm/RLMApp.mm b/Realm/RLMApp.mm index f9d31bef02..43323d2420 100644 --- a/Realm/RLMApp.mm +++ b/Realm/RLMApp.mm @@ -103,16 +103,7 @@ - (instancetype)init { self.enableSessionMultiplexing = true; self.encryptMetadata = !getenv("REALM_DISABLE_METADATA_ENCRYPTION") && !RLMIsRunningInPlayground(); RLMNSStringToStdString(_clientConfig.base_file_path, RLMDefaultDirectoryForBundleIdentifier(nil)); - - _config.device_info.sdk = "Realm Swift"; - - // Platform info isn't available when running via `swift test`. - // Non-Xcode SPM builds can't build for anything but macOS, so this is - // probably unimportant for now and we can just report "unknown" - auto processInfo = [NSProcessInfo processInfo]; - RLMNSStringToStdString(_config.device_info.platform_version, - [processInfo operatingSystemVersionString] ?: @"unknown"); - RLMNSStringToStdString(_config.device_info.sdk_version, REALM_COCOA_VERSION); + configureSyncConnectionParameters(_config); } return self; } @@ -139,7 +130,6 @@ - (instancetype)initWithBaseURL:(nullable NSString *)baseURL self.localAppName = localAppName; self.localAppVersion = localAppVersion; self.defaultRequestTimeoutMS = defaultRequestTimeoutMS; - configureSyncConnectionParameters(_config); } return self; } @@ -153,6 +143,9 @@ static void configureSyncConnectionParameters(realm::app::App::Config& config) { config.device_info.sdk = "Realm Swift"; RLMNSStringToStdString(config.device_info.sdk_version, REALM_COCOA_VERSION); + // Platform info isn't available when running via `swift test`. + // Non-Xcode SPM builds can't build for anything but macOS, so this is + // probably unimportant for now and we can just report "unknown" auto processInfo = [NSProcessInfo processInfo]; RLMNSStringToStdString(config.device_info.platform_version, [processInfo operatingSystemVersionString] ?: @"unknown"); diff --git a/Realm/RLMDictionary.h b/Realm/RLMDictionary.h index 99f98b92aa..9c8cac5386 100644 --- a/Realm/RLMDictionary.h +++ b/Realm/RLMDictionary.h @@ -40,6 +40,8 @@ RLM_HEADER_AUDIT_BEGIN(nullability, sendability) `RLMDictionary`s cannot be created directly. `RLMDictionary` properties on `RLMObject`s are lazily created when accessed, or can be obtained by querying a Realm. + `RLMDictionary` only supports `NSString` as a key. Realm disallows the use of `.` or `$` characters within a dictionary key. + ### Key-Value Observing `RLMDictionary` supports dictionary key-value observing on `RLMDictionary` properties on `RLMObject` diff --git a/RealmSwift/Map.swift b/RealmSwift/Map.swift index c76f5787ba..2f5d51a4a7 100644 --- a/RealmSwift/Map.swift +++ b/RealmSwift/Map.swift @@ -35,8 +35,8 @@ extension String: _MapKey { } - Note: Optional versions of the above types *except* `Object` are only supported in non-synchronized Realms. - Map only supports String as a key. - + Map only supports `String` as a key. Realm disallows the use of `.` or `$` characters within a dictionary key. + Unlike Swift's native collections, `Map`s is a reference types, and are only immutable if the Realm that manages them is opened as read-only. diff --git a/RealmSwift/Object.swift b/RealmSwift/Object.swift index 8b81fb4258..ab98a5b132 100644 --- a/RealmSwift/Object.swift +++ b/RealmSwift/Object.swift @@ -256,10 +256,11 @@ extension Object: _RealmCollectionValueInsideOptional { transaction is committed. If no key paths are given, the block will be executed on any insertion, - modification, or deletion for all object properties and the properties of - any nested, linked objects. If a key path or key paths are provided, - then the block will be called for changes which occur only on the - provided key paths. For example, if: + modification, or deletion for all object first-level properties of the object. + `Object` notifications are shallow by default, any nested property modification + will not trigger a notification, unless the key path to that property is specified. + If a key path or key paths are provided, then the block will be called for + changes which occur only on the provided key paths. For example, if: ```swift class Dog: Object { @Persisted var name: String @@ -338,10 +339,11 @@ extension Object: _RealmCollectionValueInsideOptional { transaction is committed. If no key paths are given, the block will be executed on any insertion, - modification, or deletion for all object properties and the properties of - any nested, linked objects. If a key path or key paths are provided, - then the block will be called for changes which occur only on the - provided key paths. For example, if: + modification, or deletion for all object first-level properties of the object. + `Object` notifications are shallow by default, any nested property modification + will not trigger a notification, unless the key path to that property is specified. + If a key path or key paths are provided, then the block will be called for + changes which occur only on the provided key paths. For example, i ```swift class Dog: Object { @Persisted var name: String