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

guard against null 'theirHeads' #377

Closed dan-weaver closed 3 years ago

dan-weaver commented 3 years ago

In my experimentation with they sync protocol I've come across what may be another edge case. theirHeads is sometimes null here when there are pending changes in the doc. Not sure if my implementation is bad. Should theirHeads just default to []?

ept commented 3 years ago

Hi @dan-weaver, thanks for the bug report. theirHeads being null is a valid state, so we need to fix this. However, I think the logic should be different. Could you please try 77bd0e85f7f47cde85d55c52a2c40a3e16d12509 and see if it fixes the issue for you?

dan-weaver commented 3 years ago

@ept yep works for me thanks!