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 rootTreeNode for JsonTree #135

Merged
merged 10 commits into from
Oct 17, 2023
Merged

Add rootTreeNode for JsonTree #135

merged 10 commits into from
Oct 17, 2023

Conversation

7hong13
Copy link
Contributor

@7hong13 7hong13 commented Oct 12, 2023

What this PR does / why we need it?

  • add the rootTreeNode for JsonTree and make only JsonTree.TreeNode publicly visible
  • remove SelectOpInfo
  • fix updating path of Operations (I think I missed some changes in the JS SDK.)
  • improved handling PresenceChange.Others
  • updated the sample app's code

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

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

@7hong13 7hong13 added bug 🐞 Something isn't working enhancement 🌟 New feature or request labels Oct 12, 2023
@7hong13 7hong13 requested review from hackerwins and skhugh October 12, 2023 07:24
@7hong13 7hong13 self-assigned this Oct 12, 2023
Copy link
Contributor

@skhugh skhugh left a comment

Choose a reason for hiding this comment

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

LGTM except for the failing tests 😵‍💫

Comment on lines 430 to 443
public sealed interface Others : PresenceChange {
public sealed class Others(public open val changed: PresenceInfo) : PresenceChange {

/**
* Means that the client has established a connection with the server,
* enabling real-time synchronization.
*/
public data class Watched(public val watched: PresenceInfo) : Others
public data class Watched(override val changed: PresenceInfo) : Others(changed)

/**
* Means that the client has been disconnected.
*/
public data class Unwatched(public val unwatched: PresenceInfo) : Others
public data class Unwatched(override val changed: PresenceInfo) : Others(changed)

/**
* Means that the presences of the client has been updated.
*/
public data class PresenceChanged(public val changed: PresenceInfo) : Others
public data class PresenceChanged(override val changed: PresenceInfo) :
Others(changed)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be more compact.

            public sealed interface Others : PresenceChange {
                public val changed: PresenceInfo

                /**
                 * Means that the client has established a connection with the server,
                 * enabling real-time synchronization.
                 */
                public data class Watched(override val changed: PresenceInfo) : Others

                /**
                 * Means that the client has been disconnected.
                 */
                public data class Unwatched(override val changed: PresenceInfo) : Others

                /**
                 * Means that the presences of the client has been updated.
                 */
                public data class PresenceChanged(override val changed: PresenceInfo) : Others
            }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed Others back to interface in 9ae165c.

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

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

Comparison is base (5290bdb) 83.05% compared to head (502ccec) 78.24%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
- Coverage   83.05%   78.24%   -4.82%     
==========================================
  Files          63       63              
  Lines        3654     3672      +18     
  Branches      534      572      +38     
==========================================
- Hits         3035     2873     -162     
- Misses        325      502     +177     
- Partials      294      297       +3     
Files Coverage Δ
...rkie/src/main/kotlin/dev/yorkie/core/Attachment.kt 100.00% <100.00%> (ø)
yorkie/src/main/kotlin/dev/yorkie/core/Presence.kt 100.00% <100.00%> (ø)
...tlin/dev/yorkie/document/JsonSerializableStruct.kt 61.90% <100.00%> (+8.96%) ⬆️
...c/main/kotlin/dev/yorkie/document/change/Change.kt 72.22% <100.00%> (-27.78%) ⬇️
...c/main/kotlin/dev/yorkie/document/crdt/CrdtText.kt 88.33% <ø> (-1.38%) ⬇️
...lin/dev/yorkie/document/crdt/CrdtTreeExtensions.kt 100.00% <100.00%> (ø)
...ie/src/main/kotlin/dev/yorkie/document/crdt/Rht.kt 84.00% <100.00%> (-4.47%) ⬇️
...c/main/kotlin/dev/yorkie/document/crdt/TextInfo.kt 86.20% <100.00%> (-1.68%) ⬇️
...ain/kotlin/dev/yorkie/document/json/JsonElement.kt 76.92% <100.00%> (+1.92%) ⬆️
...main/kotlin/dev/yorkie/document/json/JsonObject.kt 92.59% <100.00%> (+1.23%) ⬆️
... and 24 more

... and 13 files with indirect coverage changes

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

@7hong13 7hong13 merged commit be1e634 into main Oct 17, 2023
@7hong13 7hong13 deleted the to_tree_node branch October 17, 2023 05:37
@7hong13 7hong13 added this to the 0.4.7 milestone Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working enhancement 🌟 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants