-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Migrating and enabling sync session integration test #6884
Conversation
This reverts commit 5b7b4c1.
# Conflicts: # realm/realm-library/build.gradle # realm/realm-library/src/objectServer/java/io/realm/internal/SyncObjectServerFacade.java # realm/realm-library/src/objectServer/java/io/realm/mongodb/sync/SyncConfiguration.java # realm/realm-library/src/syncTestUtils/kotlin/io/realm/TestSyncConfigurationFactory.kt
val columnRealmInteger = MutableRealmInteger.ofNull() | ||
var columnRealmObject: SyncDog? = null | ||
var columnRealmList: RealmList<SyncDog>? = null | ||
var columnStringList: RealmList<String>? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these will fail unless made @required, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Tests using this are currently all ignore. It took me some time to realise that lists with null elements where not supported on the server. The initial upload worked and the subsequent sync failed because of mismatched schema as the server just "truncated" the nullable
parameter on the initial upload. Issue is raised on the server. Will fix in another PR when the issue is also fixed on the server.
* limitations under the License. | ||
*/ | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License is duplicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix in another PR along with the other SyncAllTypesSchema
comments.
import java.math.BigDecimal | ||
import java.util.* | ||
|
||
open class SyncSupportedTypes : RealmObject() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I get having both this class and SyncAllTypes
we should probably only keep one of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I introduced this one to enable successful testing while keeping the SyncAllTypes
to track the issues of re-syncing with the server. Did not have the overview of what actually caused the trouble (lacking server support for Double and lists with nullable elements). Will clean it up in another PR along with the other SyncAlllTypesSchema
@@ -252,17 +252,17 @@ JNIEXPORT jlong JNICALL Java_io_realm_mongodb_sync_SyncSession_nativeAddConnecti | |||
return 0; | |||
} | |||
|
|||
static JavaClass java_syncmanager_class(env, "io/realm/mongodb/sync/Sync"); | |||
static JavaMethod java_notify_connection_listener(env, java_syncmanager_class, "notifyConnectionListeners", "(Ljava/lang/String;JJ)V", true); | |||
static JavaClass java_syncmanager_class(env, "io/realm/mongodb/sync/SyncSession"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably rename the java_syncmanager_class
variables as that is no longer accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will leave it for now, but will put a not on that in the issue for cleaning up the memory leak.
Merging after full local build and test as CI does not seem to progress and the failing tests from previous CI failures seems flaky and are not related to this PR. |
This migrates the sync session test to Kotlin and reenables them for the new sync.
Issues uncovered and fixed:
partitionValue
when testing for equalityIssues uncovered but not address
Bad changeset
errors, when re-syncing the same scheme against a server after updating the partition value. Only seems to be an issue if scheme contains double (in which case the resynced type is float) or schema contains list (in which case the resynced type differs in nullability). Apparently the server does not supportDouble
and list with nullable elements. Issues are filed on server side.BlockingLoooperThread
), but needs investigation. Reasons are: