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

Flexible sync subscribe/unsubscribe API #1354

Merged
merged 50 commits into from
Nov 14, 2023
Merged

Flexible sync subscribe/unsubscribe API #1354

merged 50 commits into from
Nov 14, 2023

Conversation

desistefanova
Copy link
Contributor

@desistefanova desistefanova commented Jul 14, 2023

Implements RealmResults.subscribe() and RealmResults.unsubscribe() and MutableSubscriptionSet.clear({bool unnamedOnly = false}).
Adds cancellationToken parameter to Session.waitForDownload(), Session.waitForUpload() and SubscriptionSet.waitForSynchronization()
Fixes #1353
Related to realm/realm-kotlin#1356, realm/realm-js#5772, realm/realm-swift#7755, realm/realm-swift#8244

@desistefanova desistefanova changed the title Flex Sync Subscribe API Flexible sync subscribe API Jul 14, 2023
@desistefanova desistefanova changed the title Flexible sync subscribe API Flexible sync subscribe/unsubscribe API Jul 14, 2023
@coveralls
Copy link

coveralls commented Jul 14, 2023

Pull Request Test Coverage Report for Build 6867176225

  • 68 of 76 (89.47%) changed or added relevant lines in 5 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 88.452%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/src/app.dart 0 3 0.0%
lib/src/native/realm_core.dart 28 33 84.85%
Files with Coverage Reduction New Missed Lines %
lib/src/native/realm_core.dart 4 90.28%
Totals Coverage Status
Change from base Build 6866031870: -0.04%
Covered Lines: 3462
Relevant Lines: 3914

💛 - Coveralls

@desistefanova desistefanova marked this pull request as ready for review July 27, 2023 08:30
@desistefanova desistefanova marked this pull request as draft July 27, 2023 11:54
@desistefanova desistefanova marked this pull request as ready for review July 27, 2023 16:23
@desistefanova desistefanova marked this pull request as ready for review August 16, 2023 09:25
lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
lib/src/native/realm_core.dart Show resolved Hide resolved
lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
@@ -34,7 +34,7 @@ import 'session.dart';
import 'subscription.dart';
import 'set.dart';

export 'package:cancellation_token/cancellation_token.dart' show CancellationToken, CancelledException;
export 'package:cancellation_token/cancellation_token.dart' show CancellationToken, TimeoutCancellationToken, CancelledException;
Copy link
Contributor

@nielsenko nielsenko Aug 16, 2023

Choose a reason for hiding this comment

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

Still now fan of exporting classes from other packages.. but I know you didn't start this 😄

lib/src/results.dart Show resolved Hide resolved
@@ -272,21 +273,22 @@ class MutableSubscriptionSet extends SubscriptionSet {
return Subscription._(realmCore.insertOrAssignSubscription(this, query, name, update));
}

/// Remove the [subscription] from the set, if it exists.
/// Removes the [subscription] from the set, if it exists.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change the tense? If we do, there are doc comments on other methods like clear that should change as well..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the descriptions in this file are like this, Removes, Gets, Adds ... I will change the rest of the methods in the file.

@nirinchev nirinchev merged commit b6eb23b into main Nov 14, 2023
19 of 20 checks passed
@nirinchev nirinchev deleted the ds/subscription_api branch November 14, 2023 21:18
nirinchev added a commit that referenced this pull request Nov 30, 2023
* main:
  Don't add the ISRG X1 Root on Android (#1434)
  Wait for initial sync to complete before starting the tests (#1435)
  kn/update analyzer (#1365)
  Add vNext Changelog header (#1429)
  [Release 1.6.0] (#1428)
  Upgrade to Core 13.23.4 (#1427)
  Flexible sync subscribe/unsubscribe API (#1354)
  Use default context rather than creating a new one (#1426)
  Handle duplicate certificates (#1425)
  kn/add certificate (#1378)
  asymmetric object allow non embedded links (#1402)
  Rudimentary geospatial support (#1389)
  Core 13.20.1 sync errors changes (#1387)
  Fix RealmObject.hashCode (#1420)
  add 'ignore_for_file: type=lint' to *.g.dart files (#1413)
  kn/fix skip then iterate bug (#1410)
@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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flex Sync Subscribe API
4 participants