yorkie icon indicating copy to clipboard operation
yorkie copied to clipboard

Add `include_presences` to return active user list in `GetDocument`, `GetDocuments`

Open hackerwins opened this issue 6 months ago • 0 comments

Description:

Add include_presences to return active user list in GetDocument, GetDocuments

Currently, CodePair displays document lists using the last modified time from AdminService/GetDocuments. It would be beneficial to include a list of users currently editing documents within this list.

Screenshot 2024-08-24 at 2 09 51 PM

To achieve this, I propose adding an include_presences option to the REST APIs GetDocument and GetDocuments, allowing the return of Presence information alongside the document data. Additionally, while Yorkie clusters shard documents to specific servers, Presence information could be returned without any issues since it only requires read operations.

For reference, Liveblocks offers a similar API at /rooms/:roomId/active_users, and it recommends calling this endpoint with a frequency greater than 10 seconds, which could serve as a benchmark for our implementation.

Why:

This enhancement would enable users to see who is currently editing a document, thereby improving collaboration and transparency during the editing process.

hackerwins avatar Aug 24 '24 05:08 hackerwins