-
Notifications
You must be signed in to change notification settings - Fork 4
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
Handle local changes correctly when receiving snapshot #186
Conversation
WalkthroughThe update introduces a new method Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
==========================================
- Coverage 45.20% 45.13% -0.07%
==========================================
Files 105 105
Lines 19304 19333 +29
==========================================
Hits 8726 8726
- Misses 10578 10607 +29 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- Sources/Document/Change/ChangePack.swift (1 hunks)
- Sources/Document/Document.swift (1 hunks)
- Tests/Integration/ClientIntegrationTests.swift (1 hunks)
Additional comments not posted (3)
Sources/Document/Change/ChangePack.swift (1)
103-109
: Add a missing return statement.The method
hasSnapshot()
should include a return statement to explicitly return the result.- func hasSnapshot() -> Bool { - self.snapshot != nil + func hasSnapshot() -> Bool { + return self.snapshot != nilLikely invalid or redundant comment.
Sources/Document/Document.swift (1)
283-289
: Ensure local changes are correctly reapplied after snapshot.The added code correctly applies local changes after a snapshot is received. This ensures that local changes are not lost.
Tests/Integration/ClientIntegrationTests.swift (1)
782-815
: Comprehensive test for handling local changes with snapshot.The new test method
test_should_handle_local_changes_correctly_when_receiving_snapshot
is well-written and covers the scenario comprehensively.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
Tests