-
Notifications
You must be signed in to change notification settings - Fork 97
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
Enhance Set and Add for representing nested elements #691
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ect and array Previously, only the outer shells of object ({}) and array ([]) were added, requiring separate operations to set their internal values. The modification enables setting initial values directly within a single operation.
chacha912
force-pushed
the
set-nested-object
branch
from
November 20, 2023 07:11
31251f4
to
2e5192c
Compare
2 tasks
hackerwins
pushed a commit
to yorkie-team/yorkie
that referenced
this pull request
Nov 21, 2023
This commit is associated with yorkie-team/yorkie-js-sdk#691. Since modifications have been made to allow setting values in set and add operations, it is necessary to update the converter accordingly. This involves enabling the setting of values for objects and arrays in the converter.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
==========================================
+ Coverage 68.01% 69.12% +1.10%
==========================================
Files 58 58
Lines 8776 8787 +11
Branches 793 800 +7
==========================================
+ Hits 5969 6074 +105
+ Misses 2548 2454 -94
Partials 259 259 ☔ View full report in Codecov by Sentry. |
This commit addresses the issue of client sequences being absent on the server. It accomplishes this by preventing the update of changeID.
chacha912
force-pushed
the
set-nested-object
branch
from
November 22, 2023 10:01
876b354
to
24d7e3b
Compare
hackerwins
force-pushed
the
main
branch
2 times, most recently
from
November 23, 2023 00:49
9c5d5ca
to
baa2797
Compare
2 tasks
hackerwins
force-pushed
the
set-nested-object
branch
from
November 23, 2023 10:00
edb7ca2
to
aa5105a
Compare
hackerwins
force-pushed
the
set-nested-object
branch
from
November 23, 2023 10:07
aa5105a
to
5f6fffe
Compare
hackerwins
changed the title
Enhance Set and Add operations to include initial values
Enhance Set and Add for representing nested elements
Nov 23, 2023
@chacha912 Thanks for your contribution. |
20 tasks
This was referenced Jan 4, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it?
When setting values for objects or arrays, we first created the outer shells of objects (
{}
) and arrays ([]
), and then individually set the inner values. As a result, multiple operations were generated. This PR introduces a modification that allows setting initial values directly within a single operation, simplifying the process and reducing the number of generated operations.Consider the example of setting the shape of a circle:
as-is
In this case, the generated operations are 1, 5, and 5, respectively. Examining the undo operations in the final state reveals that each set operation is followed by a remove operation. Finally, a set operation is performed to restore the previous state of
circle = {point: { x: 0, y: 0 }, color: 'red'}
. However, due to the current set operation's limitation in setting only outer shells, it results in improper behavior.to-be
This PR enhances the set operation to handle both outer shells and inner values properly.
So it looks like the set operation is only generated once, and undo operations are applied correctly.
Any background context you want to provide?
What are the relevant tickets?
Fixes yorkie-team/yorkie#663
Checklist