derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 117 forks source link

Add deep copy to avoid duplicate ops when composing a created doc #229

Closed rkstedman closed 9 years ago

rkstedman commented 9 years ago

@nateps

In Share the create doc and the snapshot are different objects and during the tryCompose the operation is applied to the create doc and then _otApply applied the op to the snapshot. Because racer only made a shallow copy, the op was getting applied twice.