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

Implement the pushOnly flag of the pushpull API #500

Merged
merged 5 commits into from
Mar 31, 2023
Merged

Conversation

humdrum
Copy link
Contributor

@humdrum humdrum commented Mar 23, 2023

What this PR does / why we need it:

  • Extent PushPull API by adding a pushOnly flag to support Client Sync mode. (Add Sync mode per documents #482)
  • If pushOnly is true, Server makes a push-pull response with empty changes unless data has been changed.
  • If a push-pull response has changes that have already been performed by local changes on the client side. Send empty operations to prevent redoing those operations.
    • Due to that modifying operations, Deep coping of chageInfo is needed.

Which issue(s) this PR fixes:

Fixes #482 (Server side only)

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 enhancement 🌟 New feature or request label Mar 23, 2023
@humdrum humdrum requested review from hackerwins and chacha912 March 23, 2023 10:17
@humdrum humdrum self-assigned this Mar 23, 2023
@CLAassistant
Copy link

CLAassistant commented Mar 23, 2023

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #500 (a5c9cdf) into main (6f9c5ad) will decrease coverage by 0.12%.
The diff coverage is 24.00%.

❗ Current head a5c9cdf differs from pull request most recent head dfd4404. Consider uploading reports for the commit dfd4404 to get more accurate results

@@            Coverage Diff             @@
##             main     #500      +/-   ##
==========================================
- Coverage   50.43%   50.31%   -0.12%     
==========================================
  Files          64       64              
  Lines        5645     5660      +15     
==========================================
+ Hits         2847     2848       +1     
- Misses       2457     2470      +13     
- Partials      341      342       +1     
Impacted Files Coverage Δ
client/client.go 15.38% <0.00%> (-0.36%) ⬇️
server/backend/database/change_info.go 24.13% <0.00%> (-5.03%) ⬇️
server/rpc/yorkie_server.go 38.60% <71.42%> (-0.06%) ⬇️
server/backend/database/memory/database.go 52.57% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hackerwins hackerwins force-pushed the client-sync-mode branch 5 times, most recently from 18bb752 to 5532b66 Compare March 30, 2023 09:51
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

Even though it was the first PR, the operation was a bit complicated, but thank you for working on it.

@hackerwins hackerwins merged commit de71469 into main Mar 31, 2023
@hackerwins hackerwins deleted the client-sync-mode branch March 31, 2023 11:07
hackerwins added a commit that referenced this pull request Apr 3, 2023
When push-only is set to true, the Server will respond with an empty
operations unless there have been actual changes to the data. In cases
where the push-pull response contains changes that have already been
made on the client side, empty changes will be sent to prevent
redoing those operations.

Due to these modifications, deep copying of changeInfo is required.

---------

Co-authored-by: Youngteac Hong <[email protected]>
hackerwins added a commit that referenced this pull request Apr 3, 2023
When push-only is set to true, the Server will respond with an empty
operations unless there have been actual changes to the data. In cases
where the push-pull response contains changes that have already been
made on the client side, empty changes will be sent to prevent
redoing those operations.

Due to these modifications, deep copying of changeInfo is required.

---------

Co-authored-by: Youngteac Hong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Sync mode per documents
3 participants