-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Remove panic method in crdt text #522
Conversation
- go sdk crdt text has the condition that cause panic - remove panic prevent shutdown server when crdt text error occurred
Codecov Report
@@ Coverage Diff @@
## main #522 +/- ##
==========================================
- Coverage 50.61% 49.84% -0.78%
==========================================
Files 64 64
Lines 5751 5860 +109
==========================================
+ Hits 2911 2921 +10
- Misses 2471 2534 +63
- Partials 369 405 +36
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emplam27 Thanks for your contribution.
crdt.Text
uses RGATreeSplit and SplayTree. So To remove all panic from crdt.Text
, we also need to remove panic in RGATreeSplit
and SplayTree
.
### pkg/document/crdt/rga_tree_split.go
46:// argument is nil, it would panic at runtime.
49: panic("RGATreeSplitNodeID cannot be null")
351: panic("the node of the given id should be found: " + s.StructureAsString())
367: panic("offset should be less than or equal to length: " + s.StructureAsString())
### pkg/splay/splay.go
206: panic(fmt.Sprintf(
https://github.com/yorkie-team/yorkie/blob/main/design/data-structure.md#overview
But since SplayTree is also used in Array, I think it would be better to remove it from another PR(e.g. Remove panic in crdt.Array
).
@hackerwins
|
There was a problem hiding this 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. 👍
Remove panic method in crdt text
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #501
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist: