yorkie
yorkie copied to clipboard
Keep the previous stream when executing AttachDocument or DetachDocument
What would you like to be added:
Keep the previous stream when executing AttachDocument or DetachDocument
Since gRPC web does not provide a bi-directional stream, it is difficult to pass subscription information for new documents directly from WatchDocument.
When executing AttachDocument
or DetachDocument
, the document keys of subscription
established in WatchDocuments
must be updated.
https://github.com/yorkie-team/yorkie/blob/105a9a832ba98fe62f1be0708146fae25fd9eaed/yorkie/rpc/yorkie_server.go#L335-L339
Why is this needed:
- When attaching multiple documents to one client, unnecessary reconnection occurs.
Related to https://github.com/yorkie-team/yorkie-team.github.io/issues/21#issuecomment-996992572
I'm interested in this issue. Is it easy to reproduce this problem?,
Yes, it will be easy to reproduce. :)
With support for shading-based clusters, a single client now has multiple connections per document. Therefore, this issue could be closed.
https://github.com/yorkie-team/yorkie/commit/dcf4cfb6ff98173c6d02a0abed89cb847f8aaa1e