Skip to content

Incorrect get() documentation/buggy function #287

@Powersource

Description

@Powersource

This section says "If opts is passed, the message id is taken from either opts.id or opts.key" but when I test

        server.get({ id: rootKey, meta: true }, (err, rootMsg) => {

that works, but

        server.get({ key: rootKey, meta: true }, (err, rootMsg) => {

doesn't. I get this

/home/me/prj/ssb/ssb-wiki/node_modules/ssb-ref/index.js:77
  return s[0] === '%' && isLink(s)
          ^

TypeError: Cannot read property '0' of undefined
    at Object.exports.isMsgLink (/home/me/prj/ssb/ssb-wiki/node_modules/ssb-ref/index.js:77:11)
    at EventEmitter.db.get (/home/me/prj/ssb/ssb-wiki/node_modules/ssb-db/create.js:100:20)
    at apply (/home/me/prj/ssb/ssb-wiki/node_modules/muxrpc-validation/index.js:197:15)
    at EventEmitter.<anonymous> (/home/me/prj/ssb/ssb-wiki/node_modules/muxrpc-validation/index.js:86:14)
    at EventEmitter.hooked [as get] (/home/me/prj/ssb/ssb-wiki/node_modules/hoox/index.js:10:15)
    at /home/me/prj/ssb/ssb-wiki/index.js:77:16
    at /home/me/prj/ssb/ssb-wiki/node_modules/pull-stream/sinks/reduce.js:10:5
    at /home/me/prj/ssb/ssb-wiki/node_modules/pull-stream/sinks/drain.js:20:24
    at /home/me/prj/ssb/ssb-wiki/node_modules/pull-stream/throughs/through.js:19:9
    at /home/me/prj/ssb/ssb-wiki/node_modules/pull-stream/throughs/filter.js:17:11

If this is actually supposed to work, then when I skimmed the code it looked like this function came directly from flumedb so the bug might be there instead but I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions