Closed dirkmc closed 5 years ago
The problem is that msgpack-lite encodes { "id": undefined } as { "id": null }. See https://github.com/kawanet/msgpack-lite/issues/71
{ "id": undefined }
{ "id": null }
After adding a value to the RGA, the edge Map looks something like:
{ null => "cjmi30qvl00013h5ph5d0p9a6" "cjmi30qvl00013h5ph5d0p9a6" => undefined }
But after encoding it and then decoding it, it becomes:
{ null => "cjmi30qvl00013h5ph5d0p9a6" "cjmi30qvl00013h5ph5d0p9a6" => null }
So when we call RGA push(), the following lines in the push() method loop forever (because last is null instead of undefined:
RGA push()
push()
null
undefined
let last = null while (edges.has(last) && (edges.get(last) !== undefined)) { last = edges.get(last) }
@dirkmc thanks!
Fix landed in version 0.3.2.
The problem is that msgpack-lite encodes
{ "id": undefined }
as{ "id": null }
. See https://github.com/kawanet/msgpack-lite/issues/71After adding a value to the RGA, the edge Map looks something like:
But after encoding it and then decoding it, it becomes:
So when we call
RGA push()
, the following lines in thepush()
method loop forever (because last isnull
instead ofundefined
: