diff --git a/CHANGELOG.md b/CHANGELOG.md index 87a0fc5ef1..2aa20eb63c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,10 @@ This release will bump the Realm file format 24. Opening a file with an older fo * Removed property `RealmLog.level`. Log levels can be set with `RealmLog.setLevel`. (Issue [#1691](https://github.com/realm/realm-kotlin/issues/1691) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1038)) * Removed `LogConfiguration`. Log levels and custom loggers can be set with `RealmLog`. (Issue [#1691](https://github.com/realm/realm-kotlin/issues/1691) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1038)) * Removed deprecated `io.realm.kotlin.types.ObjectId`. Use `org.mongodb.kbson.BsonObjectId` or its type alias `org.mongodb.kbson.ObjectId` instead. (Issue [#1749](https://github.com/realm/realm-kotlin/issues/1749) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1082)) +* Removed deprecated `RealmClass.isEmbedded`. Class embeddeness can be check with `RealmClassKind.EMBEDDED`. (Issue [#1753](https://github.com/realm/realm-kotlin/issues/1753) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1080)) * [Sync] Removed deprecated methods `User.identity` and `User.provider`, user identities can be accessed with the already existing `User.identities`. (Issue [#1751](https://github.com/realm/realm-kotlin/issues/1751) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1083)) * [Sync] `App.allUsers` does no longer return a map, but only a list of users known locally. (Issue [#1751](https://github.com/realm/realm-kotlin/issues/1751) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1083)) +* [Sync ]Removed deprecated `DiscardUnsyncedChangesStrategy.onError`. (Issue [#1755](https://github.com/realm/realm-kotlin/issues/1755) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1085)) ### Enhancements * Support for RealmLists and RealmDictionaries in `RealmAny`. (Issue [#1434](https://github.com/realm/realm-kotlin/issues/1434)) @@ -18,6 +20,7 @@ This release will bump the Realm file format 24. Opening a file with an older fo ### Fixed * Inserting the same typed link to the same key in a dictionary more than once would incorrectly create multiple backlinks to the object. This did not appear to cause any crashes later, but would have affecting explicit backlink count queries (eg: `...@links.@count`) and possibly notifications (Core Issue [realm/realm-core#7676](https://github.com/realm/realm-core/issues/7676) since v1.16.0). * [Sync] Automatic client reset recovery would crash when recovering AddInteger instructions on a Mixed property if its type was changed to non-integer (Core issue [realm/realm-core#7683](https://github.com/realm/realm-core/pull/7683), since v0.11.0). +* [Sync] Typos [SubscriptionSetState.SUPERSEDED], [SyncTimeoutOptions.pingKeepalivePeriod] and [SyncTimeoutOptions.pongKeepalivePeriod]. (Issue [#1754](https://github.com/realm/realm-kotlin/pull/1754) ### Compatibility * File format: Generates Realms with file format v24 (reads and upgrades file format v10 or later). diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmAnyExt.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmAnyExt.kt index 58b52eaaaf..50d6804762 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmAnyExt.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/ext/RealmAnyExt.kt @@ -71,7 +71,7 @@ public fun realmAnyListOf(vararg values: Any?): RealmAny = /** * Create a [RealmAny] containing a [RealmDictionary] with all argument values wrapped as - * [RealmAnys]s. + * [RealmAny]s. * @param values entries of the dictionary. * * See [RealmAny.create] for [RealmDictionaries] constraints and examples of usage. diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt index 425e31397c..65160db22c 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmMapInternal.kt @@ -797,7 +797,7 @@ internal class ManagedRealmDictionary constructor( } override fun changeFlow(scope: ProducerScope>): ChangeFlow, MapChange> = - RealmDictonaryChangeFlow(scope) + RealmDictionaryChangeFlow(scope) override fun thaw(liveRealm: RealmReference): ManagedRealmDictionary? { return RealmInterop.realm_dictionary_resolve_in(nativePointer, liveRealm.dbPointer) @@ -820,7 +820,7 @@ internal class ManagedRealmDictionary constructor( // TODO add equals and hashCode when https://github.com/realm/realm-kotlin/issues/1097 is fixed } -internal class RealmDictonaryChangeFlow(scope: ProducerScope>) : +internal class RealmDictionaryChangeFlow(scope: ProducerScope>) : ChangeFlow, MapChange>(scope) { override fun initial(frozenRef: ManagedRealmMap): MapChange = InitialDictionaryImpl(frozenRef) diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/query/ScalarQuery.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/query/ScalarQuery.kt index 89a9eeeb59..2c7911e5bc 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/query/ScalarQuery.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/query/ScalarQuery.kt @@ -81,7 +81,7 @@ internal abstract class BaseScalarQuery constructor( } /** - * Returns how many objects there are. The result is devliered as a [Long]. + * Returns how many objects there are. The result is delivered as a [Long]. */ internal class CountQuery constructor( realmReference: RealmReference, diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmClassImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmClassImpl.kt index 17eb732f95..f6c91c7770 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmClassImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmClassImpl.kt @@ -39,8 +39,6 @@ public data class RealmClassImpl( it.type.run { this is ValuePropertyType && isPrimaryKey } } - override val isEmbedded: Boolean = cinteropClass.isEmbedded - override val kind: RealmClassKind get() = when { cinteropClass.isEmbedded -> RealmClassKind.EMBEDDED diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmElementQuery.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmElementQuery.kt index 78326031ea..76f7ed0b34 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmElementQuery.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmElementQuery.kt @@ -36,7 +36,7 @@ public interface RealmElementQuery : Deleteable { * Finds all objects that fulfill the query conditions and returns them in a blocking fashion. * * It is not recommended launching heavy queries from the UI thread as it may result in a drop - * of frames or even ANRs. Use [asFlow] to obtain results of such queries asynchroneously instead. + * of frames or even ANRs. Use [asFlow] to obtain results of such queries asynchronously instead. * * @return a [RealmResults] instance containing matching objects. If no objects match the * condition, an instance with zero objects is returned. diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmScalarQuery.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmScalarQuery.kt index c323275589..84f342a822 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmScalarQuery.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmScalarQuery.kt @@ -33,7 +33,7 @@ public interface RealmScalarQuery { * - `[sum]` returns the `type` specified in the call to said function * * It is not recommended launching heavy queries from the UI thread as it may result in a drop - * of frames or even ANRs. Use [asFlow] to obtain results of such queries asynchroneously instead. + * of frames or even ANRs. Use [asFlow] to obtain results of such queries asynchronously instead. * * @return a [T] containing the result of the scalar query. */ diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmSingleQuery.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmSingleQuery.kt index e73eab1804..bd0f6fc823 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmSingleQuery.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/RealmSingleQuery.kt @@ -32,7 +32,7 @@ public interface RealmSingleQuery : Deleteable { * fashion. * * It is not recommended launching heavy queries from the UI thread as it may result in a drop - * of frames or even ANRs. Use [asFlow] to obtain results of such queries asynchroneously instead. + * of frames or even ANRs. Use [asFlow] to obtain results of such queries asynchronously instead. * * @return a [RealmObject] or [EmbeddedRealmObject] instance or `null` if no object matches the condition. */ diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmClass.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmClass.kt index 4e33bb4a15..8b2e53f4ca 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmClass.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmClass.kt @@ -36,12 +36,6 @@ public interface RealmClass { */ public val primaryKey: RealmProperty? - /** - * Returns whether or not the class is embedded. - */ - @Deprecated("This property has been deprecated.", ReplaceWith("kind == RealmClassKind.EMBEDDED", "io.realm.kotlin.schema.RealmClassKind")) - public val isEmbedded: Boolean - /** * Returns what type of Realm model class this is. */ diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmAny.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmAny.kt index 309aa33d7b..fc9d2ec741 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmAny.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmAny.kt @@ -87,7 +87,7 @@ import kotlin.reflect.KClass * `RealmAny` can contain other [RealmList] and [RealmDictionary] of [RealmAny]. This means that * you can build nested collections inside a `RealmAny`-field. * ``` - * realmObjct.realmAnyField = realmAnyListOf( + * realmObject.realmAnyField = realmAnyListOf( * // Primitive values can be added in collections * 1, * // Lists and dictionaries can contain other nested collection types @@ -400,7 +400,7 @@ public interface RealmAny { * ), * realmDictionaryOf( * "key1" to realmListOf(), - * "key2" to realmDictioneryOf()) + * "key2" to realmDictionaryOf()) * ) * ``` */ @@ -413,7 +413,7 @@ public interface RealmAny { * To create a [RealmAny] containing a [RealmDictionary] of arbitrary values wrapped in * [RealmAny]s use the [io.realm.kotlin.ext.realmAnyDictionaryOf]. * - * A `RealmDictionery` can contain all [RealmAny] types, also other collection types: + * A `RealmDictionary` can contain all [RealmAny] types, also other collection types: * ``` * class SampleObject() : RealmObject { * val realmAnyField: RealmAny? = null @@ -422,7 +422,7 @@ public interface RealmAny { * * // Dictionaries can contain other collections, but only `RealmList` and * // `RealmDictionary`. - * realmObjct.realmAnyField = realmAnyDictionaryOf( + * realmObject.realmAnyField = realmAnyDictionaryOf( * "int" to 5, * // Lists and dictionaries can contain other nested collection types * "list" to realmListOf( diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmMap.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmMap.kt index 7a03c805f9..8ac01c8395 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmMap.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmMap.kt @@ -57,7 +57,7 @@ public interface RealmMap : MutableMap { * * @param keyPaths An optional list of model class properties that defines when a change to * objects inside the map will result in a change being emitted. For maps, keypaths are - * evaluted based on the values of the map. This means that keypaths are only supported + * evaluated based on the values of the map. This means that keypaths are only supported * for maps containing realm objects. Nested properties can be defined using a dotted syntax, * e.g. `parent.child.name`. Wildcards `*` can be be used to capture all properties at a given * level, e.g. `child.*` or `*.*`. If no keypaths are provided, changes to all top-level diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/AppConfigurationImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/AppConfigurationImpl.kt index d172d6c173..1f7a7bdb21 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/AppConfigurationImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/AppConfigurationImpl.kt @@ -195,11 +195,11 @@ public class AppConfigurationImpl @OptIn(ExperimentalKBsonSerializerApi::class) ) RealmInterop.realm_sync_client_config_set_ping_keepalive_period( syncClientConfig, - syncTimeoutOptions.pingKeepalivePeriod.inWholeMilliseconds.toULong() + syncTimeoutOptions.pingKeepAlivePeriod.inWholeMilliseconds.toULong() ) RealmInterop.realm_sync_client_config_set_pong_keepalive_timeout( syncClientConfig, - syncTimeoutOptions.pongKeepalivePeriod.inWholeMilliseconds.toULong() + syncTimeoutOptions.pongKeepAlivePeriod.inWholeMilliseconds.toULong() ) RealmInterop.realm_sync_client_config_set_fast_reconnect_limit( syncClientConfig, diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BaseSubscriptionSetImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BaseSubscriptionSetImpl.kt index aa73fe4586..5f8bd03bec 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BaseSubscriptionSetImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/BaseSubscriptionSetImpl.kt @@ -128,7 +128,7 @@ internal abstract class BaseSubscriptionSetImpl( CoreSubscriptionSetState.RLM_SYNC_SUBSCRIPTION_ERROR -> SubscriptionSetState.ERROR CoreSubscriptionSetState.RLM_SYNC_SUBSCRIPTION_SUPERSEDED -> - SubscriptionSetState.SUPERCEDED + SubscriptionSetState.SUPERSEDED CoreSubscriptionSetState.RLM_SYNC_SUBSCRIPTION_AWAITING_MARK -> SubscriptionSetState.AWAITING_MARK else -> TODO("Unsupported state: $coreState") diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncConfigurationImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncConfigurationImpl.kt index ddcf819081..012736d418 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncConfigurationImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncConfigurationImpl.kt @@ -464,12 +464,6 @@ private class DiscardUnsyncedChangesHelper constructor( appPointer: RealmAppPointer, error: SyncError ) { - // If there is a user exception we appoint it as the cause of the client reset - strategy.onError( - session, - ClientResetRequiredException(appPointer, error) - ) - // TODO call both onError and onManualResetFallback until the deprecated function is removed strategy.onManualResetFallback( session, ClientResetRequiredException(appPointer, error) diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SubscriptionSetState.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SubscriptionSetState.kt index dc9b98c56c..c54247d1fc 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SubscriptionSetState.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SubscriptionSetState.kt @@ -55,7 +55,7 @@ public enum class SubscriptionSetState { * are ignored by the server. Get the latest subscription set by calling * [SubscriptionSet.refresh]. */ - SUPERCEDED, + SUPERSEDED, /** * The last bootstrap message containing the initial state for this subscription set has been received. The diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncClientResetStrategy.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncClientResetStrategy.kt index d10fe6c6b7..4b38204122 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncClientResetStrategy.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncClientResetStrategy.kt @@ -113,7 +113,7 @@ public interface ManuallyRecoverUnsyncedChangesStrategy : SyncClientResetStrateg * the reset has concluded, [onAfterReset] will be invoked with both the instance before (read only) * an instance of the final realm (mutable). * - * In the event that discarding the unsynced data is not enough to resolve the reset the [onError] + * In the event that discarding the unsynced data is not enough to resolve the reset the [onManualResetFallback] * callback will be invoked allowing to manually resolve the reset as it would be done in * [ManuallyRecoverUnsyncedChangesStrategy.onClientReset]. */ @@ -127,16 +127,6 @@ public interface DiscardUnsyncedChangesStrategy : AutomaticClientResetStrategy { * @param after [MutableRealm] realm after the reset. */ public fun onAfterReset(before: TypedRealm, after: MutableRealm) - - /** - * Callback that indicates the seamless Client reset couldn't complete. It should be handled - * as in [ManuallyRecoverUnsyncedChangesStrategy.onClientReset]. - * - * @param session [SyncSession] during which this error happened. - * @param exception [ClientResetRequiredException] the specific Client Reset error. - */ - @Deprecated("Use onManualResetFallback()") - public fun onError(session: SyncSession, exception: ClientResetRequiredException) } /** diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptions.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptions.kt index 173b6041c1..e4236ca854 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptions.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptions.kt @@ -42,16 +42,16 @@ public data class SyncTimeoutOptions( * How long to wait between each ping message sent to the server. The client periodically * sends ping messages to the server to check if the connection is still alive. Shorter * periods make connection state change notifications more responsive at the cost of - * more trafic. + * more traffic. */ - val pingKeepalivePeriod: Duration, + val pingKeepAlivePeriod: Duration, /** * How long to wait for the server to respond to a ping message. Shorter values make * connection state change notifications more responsive, but increase the chance of * spurious disconnections. */ - val pongKeepalivePeriod: Duration, + val pongKeepAlivePeriod: Duration, /** * When a client first connects to the server, it downloads all data from the server diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptionsBuilder.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptionsBuilder.kt index 94df5f9692..0255a37fd5 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptionsBuilder.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncTimeoutOptionsBuilder.kt @@ -68,9 +68,9 @@ public class SyncTimeoutOptionsBuilder { * * @throws IllegalArgumentException if the duration is outside the allowed range. */ - public var pingKeepalivePeriod: Duration = 1.minutes + public var pingKeepAlivePeriod: Duration = 1.minutes set(value) { - Validation.require(value > 5.seconds) { "pingKeepalivePeriod must be a positive duration > 5 seconds. This was: $value" } + Validation.require(value > 5.seconds) { "pingKeepAlivePeriod must be a positive duration > 5 seconds. This was: $value" } field = value } @@ -83,9 +83,9 @@ public class SyncTimeoutOptionsBuilder { * * @throws IllegalArgumentException if the duration is outside the allowed range. */ - public var pongKeepalivePeriod: Duration = 2.minutes + public var pongKeepAlivePeriod: Duration = 2.minutes set(value) { - Validation.require(value > 5.seconds) { "pongKeepalivePeriod must be a positive duration > 5 seconds. This was: $value" } + Validation.require(value > 5.seconds) { "pongKeepAlivePeriod must be a positive duration > 5 seconds. This was: $value" } field = value } @@ -113,8 +113,8 @@ public class SyncTimeoutOptionsBuilder { internal fun build() = SyncTimeoutOptions( connectTimeout = this.connectTimeout, connectionLingerTime = this.connectionLingerTime, - pingKeepalivePeriod = this.pingKeepalivePeriod, - pongKeepalivePeriod = this.pongKeepalivePeriod, + pingKeepAlivePeriod = this.pingKeepAlivePeriod, + pongKeepAlivePeriod = this.pongKeepAlivePeriod, fastReconnectLimit = this.fastReconnectLimit ) } diff --git a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSchemaTests.kt b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSchemaTests.kt index 5bb4e0f5a6..1592abf877 100644 --- a/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSchemaTests.kt +++ b/packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/RealmSchemaTests.kt @@ -96,21 +96,18 @@ class RealmSchemaTests { val schemaVariationsDescriptor = schema[SCHEMA_VARIATION_CLASS_NAME] ?: fail("Couldn't find class") assertEquals(SCHEMA_VARIATION_CLASS_NAME, schemaVariationsDescriptor.name) - assertFalse(schemaVariationsDescriptor.isEmbedded) assertEquals(schemaVariationsDescriptor.kind, RealmClassKind.STANDARD) assertEquals("string", schemaVariationsDescriptor.primaryKey?.name) val sampleName = "Sample" val sampleDescriptor = schema[sampleName] ?: fail("Couldn't find class") assertEquals(sampleName, sampleDescriptor.name) - assertFalse(sampleDescriptor.isEmbedded) assertNotEquals(sampleDescriptor.kind, RealmClassKind.EMBEDDED) assertNull(sampleDescriptor.primaryKey) val embeddedChildName = "EmbeddedChild" val embeddedChildDescriptor = schema[embeddedChildName] ?: fail("Couldn't find class") assertEquals(embeddedChildName, embeddedChildDescriptor.name) - assertTrue(embeddedChildDescriptor.isEmbedded) assertEquals(embeddedChildDescriptor.kind, RealmClassKind.EMBEDDED) assertNull(embeddedChildDescriptor.primaryKey) } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/AppConfigurationTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/AppConfigurationTests.kt index 2239de354a..530ceb7ced 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/AppConfigurationTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/AppConfigurationTests.kt @@ -503,8 +503,8 @@ class AppConfigurationTests { with(config.syncTimeoutOptions) { assertEquals(2.minutes, connectTimeout) assertEquals(30.seconds, connectionLingerTime) - assertEquals(1.minutes, pingKeepalivePeriod) - assertEquals(2.minutes, pongKeepalivePeriod) + assertEquals(1.minutes, pingKeepAlivePeriod) + assertEquals(2.minutes, pongKeepAlivePeriod) assertEquals(1.minutes, fastReconnectLimit) } } @@ -515,16 +515,16 @@ class AppConfigurationTests { .syncTimeouts { connectTimeout = 10.seconds connectionLingerTime = 10.seconds - pingKeepalivePeriod = 10.seconds - pongKeepalivePeriod = 10.seconds + pingKeepAlivePeriod = 10.seconds + pongKeepAlivePeriod = 10.seconds fastReconnectLimit = 10.seconds } .build() with(config.syncTimeoutOptions) { assertEquals(10.seconds, connectTimeout) assertEquals(10.seconds, connectionLingerTime) - assertEquals(10.seconds, pingKeepalivePeriod) - assertEquals(10.seconds, pongKeepalivePeriod) + assertEquals(10.seconds, pingKeepAlivePeriod) + assertEquals(10.seconds, pongKeepAlivePeriod) assertEquals(10.seconds, fastReconnectLimit) } } @@ -540,13 +540,13 @@ class AppConfigurationTests { connectionLingerTime = 0.seconds } assertFailsWith { - pingKeepalivePeriod = 5.seconds + pingKeepAlivePeriod = 5.seconds } assertFailsWith { - pongKeepalivePeriod = 5.seconds + pongKeepAlivePeriod = 5.seconds } assertFailsWith { - pongKeepalivePeriod = 1.seconds + pongKeepAlivePeriod = 1.seconds } } } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncClientResetIntegrationTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncClientResetIntegrationTests.kt index ede31b9391..3a1011c711 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncClientResetIntegrationTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncClientResetIntegrationTests.kt @@ -391,13 +391,6 @@ class SyncClientResetIntegrationTests { channel.trySendOrFail(ClientResetEvents.ON_AFTER_RESET) } - override fun onError( - session: SyncSession, - exception: ClientResetRequiredException - ) { - fail("onError shouldn't be called: ${exception.message}") - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException @@ -485,13 +478,6 @@ class SyncClientResetIntegrationTests { channel.trySendOrFail(ClientResetEvents.ON_AFTER_RESET) } - override fun onError( - session: SyncSession, - exception: ClientResetRequiredException - ) { - fail("onError shouldn't be called: ${exception.message}") - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException @@ -584,14 +570,6 @@ class SyncClientResetIntegrationTests { fail("Should not call onAfterReset") } - override fun onError( - session: SyncSession, - exception: ClientResetRequiredException - ) { - // Just notify the callback has been invoked, do the assertions in onManualResetFallback - channel.trySendOrFail(ClientResetEvents.ON_MANUAL_RESET_FALLBACK) - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException @@ -619,8 +597,6 @@ class SyncClientResetIntegrationTests { with(realm.syncSession as SyncSessionImpl) { simulateSyncError(ErrorCode.RLM_ERR_AUTO_CLIENT_RESET_FAILED) - // TODO Twice until the deprecated method is removed - assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) } } @@ -660,14 +636,6 @@ class SyncClientResetIntegrationTests { fail("Should not call onAfterReset") } - override fun onError( - session: SyncSession, - exception: ClientResetRequiredException - ) { - // Just notify the callback has been invoked, do the assertions in onManualResetFallback - channel.trySendOrFail(ClientResetEvents.ON_MANUAL_RESET_FALLBACK) - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException @@ -695,8 +663,6 @@ class SyncClientResetIntegrationTests { with(realm.syncSession) { downloadAllServerChanges(defaultTimeout) app.triggerClientReset(syncMode, this, user.id) - // Twice until the deprecated method is removed - assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) } } @@ -738,23 +704,6 @@ class SyncClientResetIntegrationTests { channel.trySendOrFail(ClientResetEvents.ON_AFTER_RESET) } - override fun onError( - session: SyncSession, - exception: ClientResetRequiredException - ) { - // Notify that this callback has been invoked - assertEquals( - "[Sync][AutoClientResetFailed(1028)] A fatal error occurred during client reset: 'User-provided callback failed'.", - exception.message - ) - assertIs(exception.cause) - assertEquals( - "User exception", - exception.cause?.message - ) - channel.trySendOrFail(ClientResetEvents.ON_MANUAL_RESET_FALLBACK) - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException @@ -782,7 +731,6 @@ class SyncClientResetIntegrationTests { // Validate that the client reset was triggered successfully assertEquals(ClientResetEvents.ON_BEFORE_RESET, channel.receiveOrFail()) assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) - assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) } } @@ -834,18 +782,6 @@ class SyncClientResetIntegrationTests { throw IllegalStateException("User exception") } - override fun onError( - session: SyncSession, - exception: ClientResetRequiredException - ) { - // Notify that this callback has been invoked - assertEquals( - "[Sync][AutoClientResetFailed(1028)] A fatal error occurred during client reset: 'User-provided callback failed'.", - exception.message - ) - channel.trySendOrFail(ClientResetEvents.ON_MANUAL_RESET_FALLBACK) - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException @@ -868,9 +804,6 @@ class SyncClientResetIntegrationTests { // Validate that the client reset was triggered successfully assertEquals(ClientResetEvents.ON_BEFORE_RESET, channel.receiveOrFail()) assertEquals(ClientResetEvents.ON_AFTER_RESET, channel.receiveOrFail()) - - // TODO Twice until the deprecated method is removed - assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) assertEquals(ClientResetEvents.ON_MANUAL_RESET_FALLBACK, channel.receiveOrFail()) } } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt index e090cd929c..235dadff6b 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SyncConfigTests.kt @@ -1050,10 +1050,6 @@ class SyncConfigTests { fail("Should not be called") } - override fun onError(session: SyncSession, exception: ClientResetRequiredException) { - fail("Should not be called") - } - override fun onManualResetFallback( session: SyncSession, exception: ClientResetRequiredException