diff --git a/Realm/Realm/Configurations/SyncConfigurationBase.cs b/Realm/Realm/Configurations/SyncConfigurationBase.cs index b91b69aa84..9c46725739 100644 --- a/Realm/Realm/Configurations/SyncConfigurationBase.cs +++ b/Realm/Realm/Configurations/SyncConfigurationBase.cs @@ -219,14 +219,14 @@ internal override async Task CreateRealmAsync(RealmSchema schema) // Keep that until we open the Realm on the foreground. var backgroundHandle = await SharedRealmHandleExtensions.OpenWithSyncAsync(configuration, ToNative(), schema, EncryptionKey); - var srHandle = SharedRealmHandleExtensions.OpenWithSync(configuration, ToNative(), schema, EncryptionKey); + var foregroundHandle = SharedRealmHandleExtensions.OpenWithSync(configuration, ToNative(), schema, EncryptionKey); backgroundHandle.Close(); if (IsDynamic && !schema.Any()) { - srHandle.GetSchema(nativeSchema => schema = RealmSchema.CreateFromObjectStoreSchema(nativeSchema)); + foregroundHandle.GetSchema(nativeSchema => schema = RealmSchema.CreateFromObjectStoreSchema(nativeSchema)); } - return new Realm(srHandle, this, schema); + return new Realm(foregroundHandle, this, schema); } internal Native.SyncConfiguration ToNative() diff --git a/wrappers/src/subscription_cs.cpp b/wrappers/src/subscription_cs.cpp index 3ec9df1886..ce275de56d 100644 --- a/wrappers/src/subscription_cs.cpp +++ b/wrappers/src/subscription_cs.cpp @@ -48,12 +48,11 @@ REALM_EXPORT Subscription* realm_subscription_create(Results& results, uint16_t* auto inclusion_paths = realm::generate_include_from_keypaths(paths, *results.get_realm(), results.get_object_schema(), mapping); - realm::partial_sync::SubscriptionOptions options { - name, - optional_ttl, - update, - inclusion_paths - }; + realm::partial_sync::SubscriptionOptions options; + options.user_provided_name = name; + options.time_to_live_ms = optional_ttl; + options.update = update; + options.inclusions = inclusion_paths; auto result = realm::partial_sync::subscribe(results, options); return new Subscription(std::move(result));