Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable workaround for core 7297 #1782

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ object Versions {
const val latestKotlin = "2.0.0" // https://kotlinlang.org/docs/eap.html#build-details
const val kotlinCompileTesting = "0.5.0-alpha07" // https://github.com/zacsweers/kotlin-compile-testing
const val ktlint = "0.45.2" // https://github.com/pinterest/ktlint
const val ktor = "2.3.7" // https://github.com/ktorio/ktor
const val ktor = "2.3.12" // https://github.com/ktorio/ktor
const val multidex = "2.0.1" // https://developer.android.com/jetpack/androidx/releases/multidex
const val nexusPublishPlugin = "1.1.0" // https://github.com/gradle-nexus/publish-plugin
const val okio = "3.2.0" // https://square.github.io/okio/#releases
const val relinker = "1.4.5" // https://github.com/KeepSafe/ReLinker
const val serialization = "1.6.0" // https://kotlinlang.org/docs/releases.html#release-details
const val serialization = "1.7.1" // https://kotlinlang.org/docs/releases.html#release-details
const val shadowJar = "6.1.0" // https://mvnrepository.com/artifact/com.github.johnrengelman.shadow/com.github.johnrengelman.shadow.gradle.plugin?repo=gradle-plugins
const val snakeYaml = "1.33" // https://github.com/snakeyaml/snakeyaml
val sourceCompatibilityVersion = JavaVersion.VERSION_1_8 // Language level of any Java source code.
Expand Down
1 change: 1 addition & 0 deletions packages/test-sync/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ kotlin {
implementation("io.ktor:ktor-client-logging:${Versions.ktor}")
implementation("io.ktor:ktor-serialization-kotlinx-json:${Versions.ktor}")
implementation("io.ktor:ktor-client-content-negotiation:${Versions.ktor}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serialization}")

implementation("com.squareup.okio:okio:${Versions.okio}")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package io.realm.kotlin.test.mongodb

import io.realm.kotlin.Realm
import io.realm.kotlin.annotations.ExperimentalRealmSerializerApi
import io.realm.kotlin.internal.interop.RealmInterop
import io.realm.kotlin.internal.interop.SynchronizableObject
Expand All @@ -31,15 +30,12 @@ import io.realm.kotlin.mongodb.AppConfiguration
import io.realm.kotlin.mongodb.Credentials
import io.realm.kotlin.mongodb.User
import io.realm.kotlin.mongodb.internal.AppConfigurationImpl
import io.realm.kotlin.mongodb.sync.SyncConfiguration
import io.realm.kotlin.test.mongodb.common.FLEXIBLE_SYNC_SCHEMA
import io.realm.kotlin.test.mongodb.util.AppAdmin
import io.realm.kotlin.test.mongodb.util.AppAdminImpl
import io.realm.kotlin.test.mongodb.util.AppInitializer
import io.realm.kotlin.test.mongodb.util.AppServicesClient
import io.realm.kotlin.test.platform.PlatformUtils
import io.realm.kotlin.test.util.TestHelper
import io.realm.kotlin.test.util.use
import kotlinx.coroutines.CloseableCoroutineDispatcher
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down Expand Up @@ -113,28 +109,6 @@ open class TestApp private constructor(
)
)

init {
// For apps with Flexible Sync, we need to bootstrap all the schemas to work around
// https://github.com/realm/realm-core/issues/7297.
// So we create a dummy Realm, upload all the schemas and close the Realm again.
if (app.configuration.appId.startsWith(TEST_APP_FLEX, ignoreCase = false)) {
runBlocking {
val user = app.login(Credentials.anonymous())
val config = SyncConfiguration.create(user, FLEXIBLE_SYNC_SCHEMA)
try {
Realm.open(config).use {
// Using syncSession.uploadAllLocalChanges() seems to just hang forever.
// This is tracked by the above Core issue. Instead use the Sync Progress
// endpoint to signal when the schemas are ready.
pairAdminApp.second.waitForSyncBootstrap()
}
} finally {
user.delete()
}
}
}
}

fun createUserAndLogin(): User = runBlocking {
val (email, password) = TestHelper.randomEmail() to "password1234"
emailPasswordAuth.registerUser(email, password).run {
Expand Down
Loading
Loading