How to trace delete modification

hello !

I am working on the version compare now.

Based on the paper here, .

if clientA type sequentially, described as C(clientA,0,10), clientB deleted the last 7 character, C(clientA, 0 ,10) will split into two parts : C(clientA, 0, 3) and C(X, 0,7) which is only marked as deleted. My local demo shows that the X in C(X, 0, 7) is clientA’s ydoc ClientID rather than ClientB’s …

I have no clue how to trace this kind of delete operations ( userB delete userA’s content) if yjs/crdt work in the way above.

i dived into the version demo:, seems Y.PermanentUserData will overwrite the delete struct and getUserByDeletedId.

i am wondering that how can i track which user delete other’s content without PermanentUserData, cus based on my test demo, clientB delete clientA’s content, yjs only mark clientA’s content as deleted, clientB’s modification not recorded at all, isn’t ?

Is my understanding correct ?

Deletions only mark an Item as deleted. Yjs doesn’t keep track of who deletes what. You understood correctly that without PermanentUserData, you can’t keep track of this kind of information.

FYI: PermanentUserData tracks deletes. The implementation of PermanentUserData is not finished and there will likely be future updates. But the concept will remain. You need another datastore to keep track of deletes.

1 Like

wow~ cooool! thanks a lot!