From d8c839d395f9122fb093ce6ff9566de6ebd25981 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Mon, 8 Apr 2024 11:57:26 +0200 Subject: [PATCH] RKOTLIN-1033: Update default base url (#1718) --- CHANGELOG.md | 59 ++++++++++--------- .../realm/kotlin/mongodb/AppConfiguration.kt | 2 +- .../mongodb/common/AppConfigurationTests.kt | 2 +- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5436cd709b..7ed745c5c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This release will bump the Realm file format from version 23 to 24. Opening a fi * Index on list of strings property now supported (Core issue [realm/realm-core#7142](https://github.com/realm/realm-core/pull/7142)) * Improved performance of RQL (parsed) queries on a non-linked string property using: >, >=, <, <=, operators and fixed behaviour that a null string should be evaulated as less than everything, previously nulls were not matched. (Core issue [realm/realm-core#3939](https://github.com/realm/realm-core/issues/3939). * Updated bundled OpenSSL version to 3.2.0 (Core issue [realm/realm-core#7303](https://github.com/realm/realm-core/pull/7303)) +* The default base url in `AppConfiguration` has been updated to point to `services.cloud.mongodb.com`. See https://www.mongodb.com/docs/atlas/app-services/domain-migration/ for more information. (Issue [#1685](https://github.com/realm/realm-kotlin/issues/1685)) ### Fixed * Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (Core issue [realm/realm-core#2573](https://github.com/realm/realm-core/issues/2573)) @@ -23,7 +24,7 @@ This release will bump the Realm file format from version 23 to 24. Opening a fi * Fixed equality queries on a `RealmAny` property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (Core issue [realm/realm-core6407](https://github.com/realm/realm-core/issues/6407) since v11.0.0-beta.5). * If you have more than 8388606 links pointing to one specific object, the program will crash. (Core issue [realm/realm-core#6577](https://github.com/realm/realm-core/issues/6577), since v6.0.0) * Query for NULL value in `RealmAny` would give wrong results (Core issue [realm/realm-core6748])(https://github.com/realm/realm-core/issues/6748), since v10.0.0) -* Fixed queries like `indexed_property == NONE {x}` which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. (Core issue [realm/realm-core#7777](https://github.com/realm/realm-java/issues/7862), since v12.5.0) +* Fixed queries like `indexed_property == NONE {x}` which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. (Core issue [realm/realm-core#7777](https://github.com/realm/realm-java/issues/7862), since v12.5.0) * Uploading the changesets recovered during an automatic client reset recovery may lead to 'Bad server version' errors and a new client reset. (Core issue [realm/realm-core7279](https://github.com/realm/realm-core/issues/7279), since v13.24.1) * Fixed crash in fulltext index using prefix search with no matches (Core issue [realm/realm-core#7309](https://github.com/realm/realm-core/issues/7309), since v13.18.0) * Fix a minor race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. (Core issue [realm/realm-core#7341](https://github.com/realm/realm-core/pull/7341)). @@ -126,7 +127,7 @@ This release will bump the Realm file format from version 23 to 24. Opening a fi ### Fixed * Cache notification callback JNI references at startup to ensure that symbols can be resolved in core callbacks. (Issue [#1577](https://github.com/realm/realm-kotlin/issues/1577)) -* Using `Realm.asFlow()` could miss an update if a write was started right after opening the Realm. (Issue [#1582](https://github.com/realm/realm-kotlin/issues/1582)) +* Using `Realm.asFlow()` could miss an update if a write was started right after opening the Realm. (Issue [#1582](https://github.com/realm/realm-kotlin/issues/1582)) * Guarded analytic errors so that they do not fail user builds. * Using keypaths in Flows could sometimes throw `java.lang.IllegalStateException: [RLM_ERR_WRONG_THREAD]: Realm accessed from incorrect thread.`. (Issue [#1594](https://github.com/realm/realm-kotlin/pull/1594, since 1.13.0) * Non-`IllegalStateExceptions` in a `write`-block would not cancel transactions, but leave it open. (Issue [#1615](https://github.com/realm/realm-kotlin/issues/1615)). @@ -169,7 +170,7 @@ This release will bump the Realm file format from version 23 to 24. Opening a fi connection is used per sync user rather than one per synchronized Realm. This reduces resource consumption when multiple Realms are opened and will typically improve performance. The behavior can be controlled through [AppConfiguration.Builder.enableSessionMultiplexing]. It will be made the default - in a future release. (Issue [#1578](https://github.com/realm/realm-kotlin/pull/1578)) + in a future release. (Issue [#1578](https://github.com/realm/realm-kotlin/pull/1578)) * [Sync] Various sync timeout options can now be configured through `AppConfiguration.Builder.syncTimeouts()`. (Issue [#971](https://github.com/realm/realm-kotlin/issues/971)). ### Fixed @@ -217,9 +218,9 @@ This release upgrades the Sync metadata in a way that is not compatible with old * `Realm.close()` is now idempotent. * Fix error in `RealmAny.equals` that would sometimes return `true` when comparing RealmAnys wrapping same type but different values. (Issue [#1523](https://github.com/realm/realm-kotlin/pull/1523)) * [Sync] If calling a function on App Services that resulted in a redirect, it would only redirect for GET requests. (Issue [#1517](https://github.com/realm/realm-kotlin/pull/1517)) -* [Sync] Manual client reset on Windows would not trigger correctly when run inside `onManualResetFallback`. (Issue [#1515](https://github.com/realm/realm-kotlin/pull/1515)) -* [Sync] `ClientResetRequiredException.executeClientReset()` now returns a boolean indicating if the manual reset fully succeeded or not. (Issue [#1515](https://github.com/realm/realm-kotlin/pull/1515)) -* [Sync] If calling a function on App Services that resulted in a redirect, it would only redirect for +* [Sync] Manual client reset on Windows would not trigger correctly when run inside `onManualResetFallback`. (Issue [#1515](https://github.com/realm/realm-kotlin/pull/1515)) +* [Sync] `ClientResetRequiredException.executeClientReset()` now returns a boolean indicating if the manual reset fully succeeded or not. (Issue [#1515](https://github.com/realm/realm-kotlin/pull/1515)) +* [Sync] If calling a function on App Services that resulted in a redirect, it would only redirect for GET requests. (Issue [#1517](https://github.com/realm/realm-kotlin/pull/1517)) * [Sync] If calling a function on App Services that resulted in a redirect, it would only redirect for GET requests. (Issue [#1517](https://github.com/realm/realm-kotlin/pull/1517)) @@ -292,8 +293,8 @@ childA == childC ### Enhancements * Fulltext queries now support prefix search by using the * operator, like `description TEXT 'alex*'`. (Core issue [#6860](https://github.com/realm/realm-core/issues/6860)) -* Realm model classes now generate custom `toString`, `equals` and `hashCode` implementations. This makes it possible to compare by object reference across multiple collections. Note that two objects at different versions will not be considered equal, even -if the content is the same. Custom implementations of these methods will be respected if they are present. (Issue [#1097](https://github.com/realm/realm-kotlin/issues/1097)) +* Realm model classes now generate custom `toString`, `equals` and `hashCode` implementations. This makes it possible to compare by object reference across multiple collections. Note that two objects at different versions will not be considered equal, even +if the content is the same. Custom implementations of these methods will be respected if they are present. (Issue [#1097](https://github.com/realm/realm-kotlin/issues/1097)) * Support for performing geospatial queries using the new classes: `GeoPoint`, `GeoCircle`, `GeoBox`, and `GeoPolygon`. See `GeoPoint` documentation on how to persist locations. (Issue [#1403](https://github.com/realm/realm-kotlin/pull/1403)) * Support for automatic resolution of embedded object constraints during migration through `RealmConfiguration.Builder.migration(migration: AutomaticSchemaMigration, resolveEmbeddedObjectConstraints: Boolean)`. (Issue [#1464](https://github.com/realm/realm-kotlin/issues/1464) * [Sync] Add support for customizing authorization headers and adding additional custom headers to all Atlas App service requests with `AppConfiguration.Builder.authorizationHeaderName()` and `AppConfiguration.Builder.addCustomRequestHeader(...)`. (Issue [#1453](https://github.com/realm/realm-kotlin/pull/1453)) @@ -364,7 +365,7 @@ if the content is the same. Custom implementations of these methods will be resp * [Sync] Optimized the opening of Flexible Sync Realms when `waitForInitialRemoteData` is used. (Issue [#1438](https://github.com/realm/realm-kotlin/issues/1438)) ### Fixed -* [Sync] Using `SyncConfiguration.waitForInitialRemoteData()` would require a network connection, even after opening the realm file for the first time. (Issue [#1439](https://github.com/realm/realm-kotlin/pull/1439)) +* [Sync] Using `SyncConfiguration.waitForInitialRemoteData()` would require a network connection, even after opening the realm file for the first time. (Issue [#1439](https://github.com/realm/realm-kotlin/pull/1439)) ### Compatibility * File format: Generates Realms with file format v23. @@ -429,7 +430,7 @@ if the content is the same. Custom implementations of these methods will be resp * None. ### Fixed -* Deleting `RealmResults` created by `by backlinks()` would crash with `Cannot delete custom Deleteable objects: ObjectBoundRealmResults`. (Issue [#1413](https://github.com/realm/realm-kotlin/issues/1413)) +* Deleting `RealmResults` created by `by backlinks()` would crash with `Cannot delete custom Deleteable objects: ObjectBoundRealmResults`. (Issue [#1413](https://github.com/realm/realm-kotlin/issues/1413)) * Incremental compilation in combination with `@PersistedName` on model class names could result in schema errors when opening the Realm (Issue [#1401](https://github.com/realm/realm-kotlin/issues/1401)). * [Sync] Native crash if a server error was reported while using `SyncConfiguration.waitForInitialRemoteData()`. (Issue [#1401](https://github.com/realm/realm-kotlin/issues/1401)) @@ -487,12 +488,12 @@ This release bumps the minimum supported version of Kotlin from 1.7.20 to 1.8.0. ### Internal * Updated to Realm Core 13.11.0, commit d8721d7baec39571e7e5373c3f407a50d144307e. -* Updated to Sync Protocol version 9. +* Updated to Sync Protocol version 9. * Updated BAAS test server to v2023-05-15. * Updated R8 used by tests to 4.0.48. ### Contributors -* [Tim Klingeleers](https://github.com/Mardaneus86) for fixing the default `compactOnLaunch` logic. +* [Tim Klingeleers](https://github.com/Mardaneus86) for fixing the default `compactOnLaunch` logic. ## 1.8.0 (2023-05-01) @@ -538,7 +539,7 @@ This release bumps the minimum supported version of Kotlin from 1.7.20 to 1.8.0. ### Enhancements * None. - + ### Fixed * Fix compilation issue with Kotlin 1.8.20. (Issue [1346](https://github.com/realm/realm-kotlin/issues/1346)) * [Sync] Client Reset on JVM on Linux would crash with `No built-in scheduler implementation for this platform. Register your own with Scheduler::set_default_factory()` @@ -576,7 +577,7 @@ This release bumps the minimum supported version of Kotlin from 1.7.20 to 1.8.0. * [Sync] Add support for setting App Services connection identifiers through `AppConfiguration.appName` and `AppConfiguration.appVersion`, making it easier to identify connections in the server logs. (Issue (#407)[https://github.com/realm/realm-kotlin/issues/407]) * [Sync] Added `RecoverUnsyncedChangesStrategy`, an alternative automatic client reset strategy that tries to automatically recover any unsynced data from the client. * [Sync] Added `RecoverOrDiscardUnsyncedChangesStrategy`, an alternative automatic client reset strategy that tries to automatically recover any unsynced data from the client, and discards any unsynced data if recovery is not possible. This is now the default policy. - + ### Fixed * Fixed implementation of `RealmSet.iterator()` to throw `ConcurrentModificationException`s when the underlying set has been modified while iterating over it. (Issue [#1220](https://github.com/realm/realm-kotlin/issues/1220)) * Accessing an invalidated `RealmResults` now throws an `IllegalStateException` instead of a `RealmException`. (Issue [#1188](https://github.com/realm/realm-kotlin/pull/1188)) @@ -687,7 +688,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Added support for `@PersistedName` annotations for mapping a Kotlin field name to the underlying field name persisted in the Realm. (Issue [#590](https://github.com/realm/realm-kotlin/issues/590)) * [Sync] `App.close()` have been added so it is possible to close underlying ressources used by the app instance. * [Sync] Add support for progress listeners with `SyncSession.progressAsFlow(...)`. (Issue [#428](https://github.com/realm/realm-kotlin/issues/428))lin/issues/1086)) -* [Sync] `Realm.writeCopyTo(syncConfig)` now support copying a Flexible Sync Realm to another Flexible Sync Realm. +* [Sync] `Realm.writeCopyTo(syncConfig)` now support copying a Flexible Sync Realm to another Flexible Sync Realm. * [Sync] Added support for App functions, see documentation for more details. (Issue [#1110](https://github.com/realm/realm-kotlin/pull/1110)) * [Sync] Added support for custom App Services Function authentication. (Issue [#741](https://github.com/realm/realm-kotlin/issues/741)) * [Sync] Add support for accessing user auth profile metadata and custom data through the extension functions 'User.profileAsBsonDocument()' and 'User.customDataAsBsonDocument()'. (Issue [#750](https://github.com/realm/realm-kotlin/pull/750)) @@ -701,7 +702,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Realm finalizer thread would prevent JVM main thread from exiting. (Issue [#818](https://github.com/realm/realm-kotlin/issues/818)) * `RealmUUID` did not calculate the correct `hashCode`, so putting it in a `HashSet` resulted in duplicates. * JVM apps on Mac and Linux would use a native file built in debug mode, making it slower than needed. The correct native binary built in release mode is now used. Windows was not affected. (Issue [#1124](https://github.com/realm/realm-kotlin/pull/1124)) -* `RealmUUID.random()` would generate the same values when an app was re-launched from Android Studio during development. (Issue [#1123](https://github.com/realm/realm-kotlin/pull/1123)) +* `RealmUUID.random()` would generate the same values when an app was re-launched from Android Studio during development. (Issue [#1123](https://github.com/realm/realm-kotlin/pull/1123)) * Complete flows with an IllegalStateException instead of crashing when notifications cannot be delivered due to insufficient channel capacity (Issue [#1147](https://github.com/realm/realm-kotlin/issues/1147)) * Prevent "Cannot listen for changes on a deleted Realm reference"-exceptions when notifier is not up-to-date with newest updates from write transaction. * [Sync] Custom loggers now correctly see both normal and sync events. Before, sync events were just logged directly to LogCat/StdOut. @@ -834,7 +835,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi ### Breaking Changes * Minimum Kotlin version has been raised from 1.6.10 to 1.7.20. -* Support for the original (old) memory model on Kotlin Native has been dropped. Only the new Kotlin Native memory model is supported. +* Support for the original (old) memory model on Kotlin Native has been dropped. Only the new Kotlin Native memory model is supported. * Minimum Gradle version has been raised from 6.1.1 to 6.7.1. * Minimum Ktor version has been raised from 1.6.8 to 2.1.2. @@ -954,7 +955,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10 and above. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -986,7 +987,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10 and above. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1015,7 +1016,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10 and above. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1073,7 +1074,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10 and above. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1097,7 +1098,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10 and above. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1135,7 +1136,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10 and above. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1164,7 +1165,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1189,7 +1190,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1241,7 +1242,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1271,7 +1272,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10. * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1324,7 +1325,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10. * Coroutines 1.5.2-native-mt. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. @@ -1356,7 +1357,7 @@ This release will bump the Realm file format from version 22 to 23. Opening a fi * Kotlin 1.6.10. * Coroutines 1.5.2-native-mt. * AtomicFu 0.17.0. -* Minimum Gradle version: 6.1.1. +* Minimum Gradle version: 6.1.1. * Minimum Android Gradle Plugin version: 4.0.0. * Minimum Android SDK: 16. diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/AppConfiguration.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/AppConfiguration.kt index 1644a1d7e9..d5e35e37b1 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/AppConfiguration.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/AppConfiguration.kt @@ -129,7 +129,7 @@ public interface AppConfiguration { * * @see Builder#baseUrl(String) */ - public const val DEFAULT_BASE_URL: String = "https://realm.mongodb.com" + public const val DEFAULT_BASE_URL: String = "https://services.cloud.mongodb.com" /** * The default header name used to carry authorization data when making network requests 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 af8475f50c..3b97a3b0fe 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 @@ -239,7 +239,7 @@ class AppConfigurationTests { @Test fun baseUrl_defaultValue() { - val url = "https://realm.mongodb.com" + val url = "https://services.cloud.mongodb.com" val config = AppConfiguration.Builder("foo").build() assertEquals(url, config.baseUrl) }