Globally unique client id

Associating edits to users is handled by PermanentUserData . The approach is not yet stable and is not recommended for production. It associates users with client-ids. A better approach associates ranges of edits to users instead. But I’m not too worried about the current approach: The probability of reusing client-ids is still very low because we reassign client-ids when we detect that the generated client-id is (or was) already used. We always start with a fresh client-id.

Hi @dmonad - I have a question, how do I get the update user information(use PermanentUserData) in the ydoc.on(update, eventHandler) event in the y-websocket backend, i.e. the bin/utils.js.

Basically, I want to know which user did the update in the ydoc.on(update, eventHandler) event.

Appreciate your reply.

PS: Found the solution from this topic Update messages on the shared document to human readable text - #2 by dmonad, in our case, we will reuse the clientID for the same suer, so we don’t have to maintain multiple clientIDs for the same user.