Open max-nextcloud opened 4 months ago
I think this issue just changed from being theoretical to having been practically observed:
I used this script: https://github.com/nextcloud/text/blob/investigate/inconsistencies-in-document/src/tests/investigate-corruption.spec.js#L41-51
So what the screenshot is printing is tr.afterState
- which seems to be the state vector of all clients after processing that transaction.
Two things jump out here:
So it looks like two editing sessions ran in parallel for a while here before they were 'mixed'. On possible cause for this would be different initial state steps - which would lead to a split brain situation - where one client does not see the other clients changes and vice versa.
Is your feature request related to a problem? Please describe. In case two users start a new yjs session at the same time they need to initialize it with the initial ydoc content to create a consistent world view. https://github.com/nextcloud/text/pull/5589 tackles this. If for some reason the two clients come up with a different initial doc state we end up with a "split brain" situation - where both work on a similar yet different document and fail to sync fully.
Planned solution
SessionApi
on the client side.documentState
but noautosaveContent
to avoid writing unchanged documents.documentState
already exist:Tasks
SessionApi
for that endpoint.Acceptance Criteria
Open questions