statamic / collaboration

Real-time, multi-user editing with Statamic via websockets
https://statamic.com/addons/statamic/collaboration
33 stars 12 forks source link

Data loss when second user enters entry #68

Open helloiamlukas opened 1 year ago

helloiamlukas commented 1 year ago

Description

When a second user opens an entry while an other user is editing a bard field, the typed content will disappear and the cursor will focus to the end of the document.

How to reproduce

  1. User A opens an entry that includes a bard field
  2. The bard field of this entry includes at least two paragraphs/lines
  3. User A writes text in the first paragraph/line of the bard field
  4. While User A is typing, User B is opening the entry in the browser
  5. A part of the typed text of User A will disappear and the focus of the cursor will be at the end of the paragraph/line.

It seems like when the second user enters, an update is broadcasted – but this update still includes the old content.