What triggered the deletion action

When there are two client inputs, the first client input will be deleted.In addition, the observe function is no longer working

I don’t know why it triggered deletion.I put the picture of code below and hope someone can help me.

I would log the val that is passed to ymap.set to see if it is ever undefined.

It’s hard to tell just from looking. If you created a codepen or had a simple repo it would be easier for others to reproduce the issue.

code

I look forward to your help

I’m not seeing any delete changes. Do you have steps to reproduce with the repo?

First of all, thank you. Maybe my previous description is not detailed. First enter content on one page, then enter content on another page, and the content entered on the first page will be deleted

Okay, I am able to reproduce it now. Unfortunately I can’t figure out why it is deleting the key. There is no delete anywhere in the code. Very confusing! I might suggest creating an issue on the repo with steps to reproduce. I would be curious to know what is causing this behavior.

Thank you again for your reply. I have solved this problem.


When I built the y-websocket.js, I didn’t notice that y-websocket contains the dependency of yjs

Aha! That’s great to know. It really did seem like strange behavior.