The server can avoid ever having two objects with an identical position by just generating and assigning a unique position to the second insert operation.
Realtime Editing of Ordered Sequences
Evan Wallace

Another option here would be to make these lists CRDTs — what you have is in a sense already similar to Logoot.

Like what you read? Give Jonathan Clem a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.