-
Notifications
You must be signed in to change notification settings - Fork 577
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
Flexible sync #4220
Flexible sync #4220
Conversation
d37b5d2
to
ffb69e2
Compare
b959218
to
fbb6360
Compare
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.
Great work! Just have a few things I picked out and a possible discussion over naming conventions.
integration-tests/realm-apps/with-db-flx/services/local-mongodb/config.json
Show resolved
Hide resolved
c8023d4
to
ab81762
Compare
3616d49
to
3a3fe13
Compare
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'm submitting what I've managed to review today. There's still code that I haven't read yet.
integration-tests/tests/src/schemas/person-and-dog-with-object-ids.ts
Outdated
Show resolved
Hide resolved
it("throws an error if no subscriptions have been created", async function (this: RealmContext) { | ||
expect(this.realm.subscriptions.waitForSynchronization()).to.be.rejectedWith( | ||
"`waitForSynchronisation` cannot be called before creating a subscription set using `update`", | ||
); | ||
}); |
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'm wondering what the right behaviour is here.
Considering the case that Nikola mentioned where the app is killed before the flexible sync session has stabilised. In this case the user might add a call to realm.subscriptions.waitForSynchronization
to the startup of their app? If that's true, it might be better to just resolve the promise if there's nothing to wait for? This way the user doesn't have to check if there's a subscription before awaiting this.
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.
Yeah it's an interesting point. I'll bring this up for discussion and see if we can unify on an approach to it. I think if this is the desired behaviour, ideally core would behave like that rather than having SDK specific logic
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Kræn Hansen <[email protected]>
dcc2bca
to
f61345b
Compare
What, How & Why?
This PR implements flexible sync support.
Note: once this PR is merged, you will need to supply
BAAS_AWS_ACCESS_KEY_ID
andBAAS_AWS_SECRET_ACCESS_KEY
env vars when starting the Docker image.Example
☑️ ToDos
xit
'ed testsCompatibility
label is updated or copied from previous entryBreaking
label has been applied or is not necessaryIf this PR adds or changes public API's: