yorkie icon indicating copy to clipboard operation
yorkie copied to clipboard

Keep the previous stream when executing AttachDocument or DetachDocument

Open hackerwins opened this issue 2 years ago • 1 comments

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.

hackerwins avatar Dec 18 '21 04:12 hackerwins

Related to https://github.com/yorkie-team/yorkie-team.github.io/issues/21#issuecomment-996992572

hackerwins avatar Dec 18 '21 04:12 hackerwins

I'm interested in this issue. Is it easy to reproduce this problem?,

blurfx avatar Oct 21 '22 10:10 blurfx

Yes, it will be easy to reproduce. :)

hackerwins avatar Oct 21 '22 17:10 hackerwins

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

hackerwins avatar Jun 07 '23 11:06 hackerwins