Duplicate content when getting connection back after lost connection

There are a few old posts that describe the content duplication issue:

https://discuss.yjs.dev/search?q=duplicate

This one might be of help to you:

I’m not sure how the lost connection you describe is triggering it, but it seems similar. There must be some logic that thinks the Doc is empty or does not exist when it actually does. It needs to wait until it syncs to be absolutely sure the Doc hasn’t already been created before initializing it.