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 support for flexible subscriptions #496

Merged
merged 49 commits into from
May 17, 2022
Merged

Conversation

nielsenko
Copy link
Contributor

@nielsenko nielsenko commented Apr 25, 2022

Example:

    ...
    final realm = Realm(Configuration.sync(user, [Task.schema]));
    realm.subscriptions.update((mutableSubscriptions) {
      mutableSubscriptions.add(realm.all<Task>(), name: 'myTask', update: true);
    });

@cla-bot cla-bot bot added the cla: yes label Apr 25, 2022
lib/src/realm_class.dart Outdated Show resolved Hide resolved
@nielsenko nielsenko force-pushed the nielsenko/sync_config branch 3 times, most recently from ef483ff to 2ef7e13 Compare April 28, 2022 12:49
@coveralls
Copy link

coveralls commented Apr 28, 2022

Pull Request Test Coverage Report for Build 2310272717

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.677%

Totals Coverage Status
Change from base Build 2307752907: 0.0%
Covered Lines: 400
Relevant Lines: 427

💛 - Coveralls

@nielsenko nielsenko force-pushed the nielsenko/sync_config branch 2 times, most recently from 9047c2f to 7bc1673 Compare April 28, 2022 17:25
@nielsenko nielsenko self-assigned this Apr 29, 2022
@nielsenko nielsenko force-pushed the nielsenko/sync_config branch 4 times, most recently from f0ed13d to 483a3b0 Compare April 29, 2022 12:25
@nielsenko nielsenko marked this pull request as ready for review May 2, 2022 18:19
@nielsenko

This comment was marked as resolved.

Copy link
Contributor

@blagoev blagoev left a comment

Choose a reason for hiding this comment

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

I will need more details on these changes. Why do we need to reference EventLoopDispatcher type from core. Lets have a discussion about this.

@nielsenko nielsenko force-pushed the nielsenko/sync_config branch 2 times, most recently from 081545e to ffc11c0 Compare May 5, 2022 10:41
lib/src/app.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/subscription.dart Outdated Show resolved Hide resolved
lib/src/realm_class.dart Show resolved Hide resolved
lib/src/subscription.dart Outdated Show resolved Hide resolved
lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
test/subscription_test.dart Outdated Show resolved Hide resolved
@nielsenko nielsenko force-pushed the nielsenko/sync_config branch 3 times, most recently from 8036945 to dc736c3 Compare May 6, 2022 08:16
lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
String? path,
}) = InMemoryConfiguration;

factory Configuration.flexibleSync(
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we call it flexibleSync. Since we are supporting only that type of sync isn't it better to name it Configuration.sync

Copy link
Member

Choose a reason for hiding this comment

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

All our documentation and marketing talk about flexible sync. I think it'll be confusing if the dart SDK is the only one which doesn't specify the sync type. When/if we deprecate PBS, we can deprecate the "flexible" terminology across all SDKs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tend to agree with @nirinchev. I'll keep as is for this PR, we can always change later.

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 agree that docs and marketing should play here how we name this exact method. Yes we have "flexible sync" type but why put it in the config method name. We don't have any other sync. The docs could go into great detail how sync in Dart works but this should not be imposed on the method name.

Copy link
Contributor

Choose a reason for hiding this comment

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

and we are keeping the FlexibleSyncConfiguraiton class name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Who can call this decision?

lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
src/event_loop_dispatcher.hpp Outdated Show resolved Hide resolved
src/subscription_set.cpp Outdated Show resolved Hide resolved
src/subscription_set.cpp Outdated Show resolved Hide resolved
src/event_loop_dispatcher.hpp Show resolved Hide resolved
src/event_loop_dispatcher.hpp Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.