automerge / automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
http://automerge.org/
MIT License
14.75k stars 466 forks source link

Failing relative ops in the same change test #382

Closed jeffa5 closed 3 years ago

jeffa5 commented 3 years ago

I'm not completely sure that this should be failing but it seems like it should be.

The issue is that the last action of change2 is trying to insert after the update that has just occurred. I would assume that the prior update also updates the elemId of that index and so we should be able to reference it.

jeffa5 commented 3 years ago

Changing the last elemId to 2@${actor} passes.

jeffa5 commented 3 years ago

Or I suppose that list element should still have the elemId: 2@${actor} if they are supposed to be immutable?

jeffa5 commented 3 years ago

I think I've found the problem in the Rust frontend. Sequences elements should be linked to the operation that created them and updates don't change those.

ept commented 3 years ago

I think it's correct for the last op to have an elemId of 2@${actor}. Op 3@${actor} is not an insertion op so it cannot be used as the elemId of another insertion op.