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 forced sync when switching to realtime mode #134

Merged
merged 3 commits into from
Jan 17, 2024
Merged

Add forced sync when switching to realtime mode #134

merged 3 commits into from
Jan 17, 2024

Conversation

humdrum
Copy link
Contributor

@humdrum humdrum commented Jan 3, 2024

What this PR does / why we need it:
Previously, when using resume, remote changes made during the pause were not being applied. After resuming, if there have been any local or remote changes, a sync is triggered, and previous changes are applied.
This PR addresses this issue by triggering a sync during resume.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@humdrum humdrum added the bug 🐞 Something isn't working label Jan 3, 2024
@humdrum humdrum requested review from myupage and chacha912 January 3, 2024 07:07
@humdrum humdrum self-assigned this Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 79 lines in your changes are missing coverage. Please review.

Comparison is base (6c6b8c6) 43.31% compared to head (37abafc) 43.16%.

Files Patch % Lines
Tests/Integration/ClientIntegrationTests.swift 0.00% 74 Missing ⚠️
Sources/Core/Client.swift 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #134      +/-   ##
==========================================
- Coverage   43.31%   43.16%   -0.15%     
==========================================
  Files         104      104              
  Lines       22972    23051      +79     
==========================================
  Hits         9951     9951              
- Misses      13021    13100      +79     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@myupage myupage left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines 478 to 483
// NOTE(chacha912): When re-establishing real-time sync, there might have been
// changes while the connection was off. Therefore, syncing needs to be performed
// once. Currently, if syncing is called here, it overlaps with `syncInternal`,
// causing the issue of the response being applied twice. (Ref: issues#603)
// Therefore, we set `remoteChangeEventReceived` to true, allowing syncing to
// occur in `syncInternal`.
Copy link

@chacha912 chacha912 Jan 4, 2024

Choose a reason for hiding this comment

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

The comment has updated.
yorkie-team/yorkie-js-sdk#713

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chacha912 I changed the comment. Thanks.

@humdrum humdrum changed the title Fix for ensuring synchronization on resume Add forced sync when switching to realtime mode Jan 4, 2024
@humdrum humdrum requested a review from hackerwins January 4, 2024 08:29
@humdrum humdrum merged commit 9a16510 into main Jan 17, 2024
3 checks passed
@humdrum humdrum deleted the fix-resume branch January 17, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants