Closed hackerwins closed 1 month ago
The changes introduce a new Watch
function in the Client
struct for monitoring document events and modify existing functions to utilize this new method. Additionally, client activation checks are enhanced by adding an EnsureActivated
method, renaming FindClientInfo
to FindActiveClientInfo
, and updating server logic to reflect these changes. Integration tests are also updated to verify the behavior of deactivated clients.
File | Change Summary |
---|---|
client/client.go |
Added Watch function to Client struct and updated runWatchLoop to use this new method. |
server/backend/database/client_info.go |
Introduced EnsureActivated method to ClientInfo struct. |
server/clients/clients.go |
Renamed FindClientInfo to FindActiveClientInfo and added activation check logic. |
server/rpc/yorkie_server.go |
Replaced calls to FindClientInfo with FindActiveClientInfo in various yorkieServer methods. |
server/server.go |
Added DeactivateClient function in Yorkie struct and necessary imports for context and clients. |
test/integration/client_test.go |
Added import for connectrpc.com/connect and introduced a test for deactivated client's stream behavior. |
🐇 In code, we watch the docs so dear, Ensuring clients are active and clear. With tests to guard the streams so bright, Our Yorkie server's future is light. Amidst the bytes and lines so neat, The rabbit's code is quite a feat!
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?
Attention: Patch coverage is 14.70588%
with 29 lines
in your changes are missing coverage. Please review.
Project coverage is 50.52%. Comparing base (
2d71055
) to head (975a9ac
).
Files | Patch % | Lines |
---|---|---|
client/client.go | 0.00% | 13 Missing :warning: |
server/server.go | 0.00% | 10 Missing :warning: |
server/backend/database/client_info.go | 0.00% | 5 Missing :warning: |
server/rpc/yorkie_server.go | 83.33% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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