Open morganrallen opened 10 years ago
The problem appears to be handling of binary keys.
When stream-serializer decodes the in coming rows when it encounters the base64 encoded key
it is decoded to Uint8Array
.
Back in level-list when tracking the rows the id
always ends up as "[object Uint8Array]"
we can't use typed arrays as array keys, just casting to strings should help
I'm trying a couple of things. First I was thinking maybe using bytewise
to encode the key or just change 26 to
var id = Array.prototype.join.call(change.key, "");
Quick look it handles binary and non-binary with no problems.
i prefer latter, bytewise shouldn't be a dependency of level-list
So there is still a problem here. Numbers join to ""
. In better news, I'm writing unit tests for you. Ok with that? Going with tape/testling. I'll make a more robust id check and submit it shortly.
ah yeah, I never had that problem as I always use string encoding for keys. That's awesome!
Working on a reduced test case.