Concatenated changes being sent during collaboration

Hi all,

In a “good” environment, where there are no connection issues (for example), the user client sends changes to the server and these changes are received as updates in the other clients.

A typical sent change looks like this:

And similarly, updates received look like this:

Every so often, we run into a problem whilst collaborating where users will receive either large chunks of paragraphs misplaced or words/sentences repeating multiple times following a loss in connection.

From testing, we’ve found the following steps sometimes mimic the above:

  1. 2 or more users are editing simultaneously in the article (more users means a greater probability of the issue happening)
  2. 1 of the users, goes offline (to replicate a users loss of connection in production) and continues to type
  3. The offline user then reconnects and continues to type which triggers a “version out-of-sync” error. The user is then sent any missing steps to get them up-to-date with the latest version of the article, and the changes the user made whilst offline are reapplied (changes sent by user)
  4. All users then either see text in the wrong place, or, the steps that were added by the user whilst offline are then applied multiple times (updates received by all users, screenshots at the end)

At step number 3), upon reconnecting we noticed that this happened in the changes being sent:

Instead of one character being sent at a time we noticed that the characters were being concatenated and sent in one go to all connected users, giving us the following in the editor:

From looking at the messages back and forth, everything else seems normal. We send changes on (throttled) editorState changes, which simply send all the steps returned by sendableSteps, which indicates that sendableSteps in some scenarios is returning this strange looped content.

Has anyone come across this, or a similar, issue, and if so - are there any suggestions on how better to handle loss of connection?

Many thanks!

The collab extension doesn’t ever merge steps, so this is very odd. Are you entirely sure you’re implementing the communication side of the collaborative editing as documented?