Closed christianbundy closed 4 years ago
I can confirm that ssb-db's get()
is working correctly and passing the full message with metadata. Maybe something is happening in muxrpc? I'm going to move this to ssb-server.
@dominictarr @mixmix @staltz @arj03
Any chance any of you have seen this? I have to throw out a handful of messages because of this bug and I'm having a really hard time pinning down where it's losing { key }
.
REPRODUCED! It looks like ssb-ooo replaces ssbDb.get()
with a function that doesn't respect the { meta }
option.
const secretStack = require('secret-stack')
const ssbCaps = require('ssb-caps')
const ssbDb = require('ssb-db')
const initialConfig = {
caps: ssbCaps,
path: '/home/christianbundy/.ssb/'
}
const stack = secretStack(initialConfig).use(ssbDb)
const messageKey = '%I/vlF/w18anHGRox3SgxrTiG9zrSdjHAImz6vwIhyZE=.sha256'
const app = stack({})
app.get({ id: messageKey, meta: true }, (err, value) => {
if (err) throw err
console.log(value)
app.close()
})
/home/christianbundy/src/flotilla/node_modules/level-packager/node_modules/levelup/lib/levelup.js:192
err = new NotFoundError('Key not found in database [' + key + ']', err)
^
NotFoundError: Key not found in database [%I/vlF/w18anHGRox3SgxrTiG9zrSdjHAImz6vwIhyZE=.sha256]
at /home/christianbundy/src/flotilla/node_modules/level-packager/node_modules/levelup/lib/levelup.js:192:15
at /home/christianbundy/src/flotilla/node_modules/encoding-down/index.js:75:21
shell returned 1
const secretStack = require('secret-stack')
const ssbCaps = require('ssb-caps')
const ssbDb = require('ssb-db')
const initialConfig = {
caps: ssbCaps,
path: '/home/christianbundy/.ssb/'
}
const stack = secretStack(initialConfig)
.use(ssbDb)
.use(require('ssb-ooo'))
const messageKey = '%I/vlF/w18anHGRox3SgxrTiG9zrSdjHAImz6vwIhyZE=.sha256'
const app = stack({})
app.get({ id: messageKey, meta: true }, (err, value) => {
if (err) throw err
console.log(value)
app.close()
})
{ previous: '%vB7cU50Xlu6lZ9TwHvUBlJqJrSbH1+UVkZ7sqv50wxU=.sha256',
sequence: 10,
author: '@4nh94nAjLIV42+6RcNhEecVU0mXmGDOSFq49tZUYGVg=.ed25519',
timestamp: 1576151631387,
hash: 'sha256',
content:
{ type: 'post',
root: '%50uBB9Bh17wZK2vpNqGbokBqP5RDDD1/FATUxCb3eW0=.sha256',
branch: '%50uBB9Bh17wZK2vpNqGbokBqP5RDDD1/FATUxCb3eW0=.sha256',
reply:
{ '%50uBB9Bh17wZK2vpNqGbokBqP5RDDD1/FATUxCb3eW0=.sha256': '@A+NcCwRM0oFkZncytGDjD6dpX/KcxHAehvaq2vwy66c=.ed25519' },
channel: 'scuttlebutt',
recps: null,
text:
'Being security minded I was thinking about this as well: How can this system be secured against illegal or unintended use? Is it up to the "public" server moderators to prevent this, and are there any tools to assist with the moderation of such content? If so, does this mean that SB will eventually move to purely private servers? Any p2p system very quickly can fall into disarray and be used for both illegal content and spam. How do you moderate? I haven\'t yet seen a p2p system that hasn\'t eventually fallen into that... but I\'d be interested to hear ideas on how to prevent this from happening here.\n\nThe internet as a whole is a terrible place full of terrible people, and as soon as you hit the critical mass of popularity, you have to have security and controls, otherwise you quickly fall prey to first the spammers, and then later much worse things.',
mentions: [] },
signature:
'mwZNq0eXRosIUOHGliR/WJwN1IgPE0aIcfPfPtXn+HA5Mybc/NUlMrT/zEWMKs0WchdMjBXXAYVYXjlvV5J4Aw==.sig.ed25519' }
I must be doing something wrong, but I'm getting the same behavior in both JS and the CLI:
On most messages the
meta
option ensures that I receive the object as{ key, value }
, but for some reason this message seems to be getting passed as if themeta
option was disabled. Anyone have ideas why this might be?