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

Add geo types sync integration tests. #1533

Merged
merged 16 commits into from
Nov 17, 2023
Merged

Add geo types sync integration tests. #1533

merged 16 commits into from
Nov 17, 2023

Conversation

clementetb
Copy link
Contributor

@clementetb clementetb commented Oct 3, 2023

Add tests to validate we can define sync subscriptions using geo queries.

@@ -49,7 +49,7 @@ public class UserImpl(
override val loggedIn: Boolean
get() = RealmInterop.realm_user_is_logged_in(nativePointer)
override val provider: AuthenticationProvider
get() = AuthenticationProviderImpl.fromId(RealmInterop.realm_user_get_auth_provider(nativePointer))
get() = identities.first().provider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talking to JS, we should deprecate this method as it doesn't really make sense anymore and instead point people towards user.identities.

import kotlin.test.assertFails
import kotlin.time.Duration.Companion.seconds

private val GEO_SCHEMA = setOf(SyncRestaurant::class, Location::class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use this anymore. All schemas need to be the same after the server introduced the new developer mode. I have a branch you can work from.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1535


Realm.open(config).use {
it.writeBlocking {
assertFails {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the write will fail as long as the class is in the schema, instead you will probably see a compensating write?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails with RLM_ERR_NO_SUBSCRIPTION_FOR_WRITE. It is core preemptively catching the error.

@clementetb clementetb changed the base branch from releases to main October 16, 2023 12:44
# Conflicts:
#	CHANGELOG.md
#	dependencies.list
@clementetb clementetb marked this pull request as ready for review November 3, 2023 19:54
@clementetb clementetb requested a review from cmelchior November 15, 2023 09:55
Copy link
Contributor

@cmelchior cmelchior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@clementetb clementetb merged commit a88bb46 into main Nov 17, 2023
1 check passed
@clementetb clementetb deleted the ct/geo-sync-tests branch November 17, 2023 13:43
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants