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

Client reset #925

Merged
merged 130 commits into from
Nov 4, 2022
Merged

Client reset #925

merged 130 commits into from
Nov 4, 2022

Conversation

desistefanova
Copy link
Contributor

@desistefanova desistefanova commented Sep 26, 2022

Implements Client Resets support.
Added argument clientResetHandler when creating FlexibleSyncConfiguration. There are 4 possible handles that defines the mode of processing data in case of client reset:

  • RecoverOrDiscardUnsyncedChangesHandler
  • RecoverUnsyncedChangesHandler
  • DiscardUnsyncedChangesHandler
  • ManualRecoveryHandler

The default mode is RecoverOrDiscard.
Tests are added.

Fixes #353
Fixes #810

@cla-bot cla-bot bot added the cla: yes label Sep 26, 2022
lib/src/configuration.dart Outdated Show resolved Hide resolved
@desistefanova desistefanova self-assigned this Sep 26, 2022
@desistefanova desistefanova changed the title Set recoverOrDiscard as a default resync mode on client reset default resync mode Sep 26, 2022
@desistefanova desistefanova marked this pull request as draft September 26, 2022 13:22
@desistefanova desistefanova marked this pull request as ready for review September 26, 2022 16:35
@coveralls
Copy link

coveralls commented Sep 29, 2022

Pull Request Test Coverage Report for Build 3393227571

  • 65 of 102 (63.73%) changed or added relevant lines in 2 files are covered.
  • 101 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.7%) to 88.882%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/src/configuration.dart 31 68 45.59%
Files with Coverage Reduction New Missed Lines %
lib/src/native/realm_core.dart 101 89.99%
Totals Coverage Status
Change from base Build 3388009948: -0.7%
Covered Lines: 2734
Relevant Lines: 3076

💛 - Coveralls

@desistefanova desistefanova changed the title default resync mode RecoverOrDiscard default resync mode Sep 30, 2022
@desistefanova desistefanova requested review from nielsenko and nirinchev and removed request for nirinchev and nielsenko October 4, 2022 17:45
Copy link
Member

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

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

Some names need to be updated to be aligned with the other SDKs. I tried to find the meetings notes from the meeting where the names were decided, but couldn't. In any case, I just copied the names from .NET as those should be the same as what's in other SDKs.

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/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
desistefanova and others added 3 commits October 5, 2022 10:17
Co-authored-by: Nikola Irinchev <irinchev@me.com>
Co-authored-by: Nikola Irinchev <irinchev@me.com>
Co-authored-by: Nikola Irinchev <irinchev@me.com>
desistefanova and others added 3 commits November 3, 2022 17:26
* fixup client reset

* Update src/realm_dart_sync.cpp

Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>

* Update src/realm_dart_sync.cpp

Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>

* reorder parameters

* guard the full body of reset the callbacks

release unowned realms

* don't abbreviate functionname. use simple return.

Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>
test/client_reset_test.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/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/native/realm_core.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
@desistefanova desistefanova marked this pull request as draft November 3, 2022 21:31
@desistefanova desistefanova marked this pull request as ready for review November 3, 2022 22:06
lib/src/configuration.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@nielsenko nielsenko left a comment

Choose a reason for hiding this comment

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

LGTM. Have a few suggestions. Mainly to the CHANGELOG.md

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
lib/src/realm_class.dart Outdated Show resolved Hide 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.

one small suggestion

@desistefanova desistefanova merged commit 2f14e75 into master Nov 4, 2022
@desistefanova desistefanova deleted the ds/resync_mode branch November 4, 2022 12:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 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.

Client Reset Sync Client Config: resync mode
5 participants