-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Return ErrClientNotActivated for deactivated clients on WatchDocument #877
Conversation
WalkthroughThe changes introduce a new Changes
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 (
|
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 (6)
- client/client.go (2 hunks)
- server/backend/database/client_info.go (1 hunks)
- server/clients/clients.go (1 hunks)
- server/rpc/yorkie_server.go (6 hunks)
- server/server.go (2 hunks)
- test/integration/client_test.go (2 hunks)
Additional comments not posted (7)
server/clients/clients.go (1)
91-106
: The changes toFindActiveClientInfo
correctly implement the check for client activation. Consider adding a comment explaining why this check is necessary, as it represents a behavior change from the previousFindClientInfo
.server/server.go (1)
137-149
: TheDeactivateClient
function is introduced for testing purposes. Please verify the use of an empty string for the API key inGetProjectFromAPIKey
. If this is a placeholder, consider replacing it with a meaningful value or add a comment explaining its usage.server/backend/database/client_info.go (1)
196-203
: TheEnsureActivated
method correctly implements the activation check. This is a crucial part of handling deactivated clients as per the PR's objectives.test/integration/client_test.go (1)
177-208
: The new test for the behavior of a deactivated client's stream is well-implemented. It correctly checks for the expected error code when a deactivated client attempts to watch a document.server/rpc/yorkie_server.go (1)
147-147
: The replacement ofFindClientInfo
withFindActiveClientInfo
in various methods is correctly implemented. This ensures that only activated clients can interact with the system, aligning with the PR's objectives.Also applies to: 220-220, 324-324, 398-398, 517-517, 630-630
client/client.go (2)
447-465
: The implementation of theWatch
function appears correct and adheres to the described functionality of watching document events. Good use of error handling for unattached documents.
481-481
: Refactoring to use the newWatch
method inrunWatchLoop
simplifies the code and improves maintainability. Well done on encapsulating the watch document logic.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #877 +/- ##
==========================================
- Coverage 50.56% 50.52% -0.05%
==========================================
Files 70 70
Lines 10398 10419 +21
==========================================
+ Hits 5258 5264 +6
- Misses 4608 4625 +17
+ Partials 532 530 -2 ☔ View full report in Codecov by Sentry. |
What this PR does / why we need it:
Return ErrClientNotActivated for deactivated clients
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
Enhancements
Bug Fixes
Testing