Post

New in Loro: Mergeable Containers! Concurrent Map child container creations no longer overwrite. This surprising overwrite issue existed in Loro, Yjs, and Automerge. Happy to finally ship a solution!

1 repost11 likes

Root cause: normal child Container IDs include an OpId. So if two peers create a child container concurrently, they get different IDs. When both write to the same LoroMap key, one child can overwrite the other.

The fix: make the child ID independent of the creation OpId. We reuse Loro’s Root Container idea: identity from a unique string. For mergeable children, that string encodes the parent LoroMap + key, so both peers derive the same ID.