Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect get() documentation/buggy function #287

Open
Powersource opened this issue Apr 26, 2020 · 9 comments
Open

Incorrect get() documentation/buggy function #287

Powersource opened this issue Apr 26, 2020 · 9 comments

Comments

@Powersource
Copy link

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.

@mixmix
Copy link
Member

mixmix commented Jun 11, 2020

confirmed, I also recently got this behaviour :(

What do we want the actual behaviour to be?

@christianbundy
Copy link
Contributor

What do we want the actual behaviour to be?

I like 'id', but whatever the docs say is fine with me.

@mixmix
Copy link
Member

mixmix commented Jun 29, 2020 via email

@christianbundy
Copy link
Contributor

Sounds like we should just fix the docs then. 🚀

@mixmix
Copy link
Member

mixmix commented Jun 29, 2020 via email

@stale
Copy link

stale bot commented Sep 29, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Sep 29, 2020
@stale stale bot closed this as completed Oct 31, 2020
@mixmix mixmix reopened this Dec 10, 2020
@stale stale bot removed the stale label Dec 10, 2020
@christianbundy
Copy link
Contributor

(iIf you assign yourself ("I'm someone who wants this issue to stay open") then the bot will never touch it.)

@mixmix
Copy link
Member

mixmix commented Dec 10, 2020 via email

@stale
Copy link

stale bot commented Jun 2, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Jun 2, 2021
@staltz staltz removed the stale label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants