kappa-db / multifeed-index

Build an index over a set of hypercores

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Buffer not correctly initialised when deserialising state

m4gpi opened this issue · comments

Hey kappa-crew! 😺

When trying to initialise kappa-view-list with a level instance rather than memdb, I'm getting the following:

/home/kyphae/Projects/kappalog/node_modules/multifeed-index/lib/state.js:38
  var len = buf.readUInt32LE(0)
                ^

TypeError: buf.readUInt32LE is not a function
    at Object.deserializeState [as deserialize] (/home/kyphae/Projects/kappalog/node_modules/multifeed-index/lib/state.js:38:17)
    at /home/kyphae/Projects/kappalog/node_modules/multifeed-index/index.js:71:23
    at /home/kyphae/Projects/kappa-view-list/index.js:111:14
    at /home/kyphae/Projects/kappalog/node_modules/levelup/lib/levelup.js:166:5
    at /home/kyphae/Projects/kappalog/node_modules/level-packager/node_modules/encoding-down/index.js:56:5

It appears when reading back state from the .ldb file, its not correctly deserialising because its not passing through a buffer obj.

Resolved in PR here: #7

This is probably a better solution, fix in kappa-view-level: kappa-db/kappa-view-list#4