#825·automerge

New splice API issue with paths containing '/'

Author: cgauldCreated Dec 15, 2023Updated Sep 11, 2026
Labelsrust

We're investigating the use of the new splice function since we're having some issues with handling unicode and how we can reconcile changes (in both directions) between an Automerge doc and the Monaco text editor.

We've encountered an issue where splice errors with the following exception:

 RangeError: Cannot splice: RangeError: invalid op for object of type `map`

We suspect it may be due to our path containing a key with a '/' in it. Our doc structure looks like this:

typescript
{
   "unsaved": {
        "/index.ts": {
            "txt: "..."
        }
    }
}

It looks like the value function inside splice ends up taking the following value:

_root/unsaved//index.ts/txt

Which seems like it may be problematic. Would be great to get your thoughts :-)