Open Powersource opened 4 years ago
My flotilla (server used by oasis) branch for reference https://github.com/Powersource/flotilla/tree/add-peer-invites
I think I just hit this. My ssb-minimal-pub-server crashes with:
/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-keys/util.js:42
var i = buf.indexOf('.')
^
TypeError: buf.indexOf is not a function
at Object.exports.toBuffer (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-keys/util.js:42:15)
at Object.exports.verifyObj (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-keys/index.js:139:30)
at Object.exports.isInvite (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-peer-invites/types.js:32:13)
at reduce (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-peer-invites/index.js:77:14)
at /home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/flumeview-reduce/inject.js:149:39
at /home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/pull-stream/sinks/drain.js:24:37
at /home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/pull-stream/throughs/async-map.js:39:20
at mapper (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/flumedb/index.js:60:13)
at Array.unboxerMap (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-db/minimal.js:85:35)
at chainMaps (/home/ssb-pub/.nvm/versions/node/v10.24.1/lib/node_modules/ssb-minimal-pub-server/node_modules/ssb-db/minimal.js:90:14)
So I added the following two lines at https://github.com/ssbc/ssb-peer-invites/blob/491c777152c37eb60e9933209b92b3a4421e7369/types.js#L25
var util = require('util')
console.log("Peer invite: " + util.inspect(caps.peerInvite));
Which yields console output of:
Peer invite: { shs: '1KHLiKZvAvjbY1ziZEHMXawbCEIM6qwjCDm3VYRan/s=',
sign: null,
peerInvite: [Circular] }
Which appears to be what's causing it. If I uncomment the return true
line and skip all that, the pub seems to operate as it should.
Easiest solution might be to uninstall peer-invites, I don't think it's widely adopted.
If the general sentiment is that this module is obsolete, then there should probably be a deprecation notice added to the README.
I think it's used in ssb-browser-demo and patchbay. Patchbay isn't maintained and the other one's a demo. I also don't think this module supports db2 or will. You can still use it so maybe obsolete is the wrong word, but maybe not recommended to adopt.
Installed the plugins (in the right order hopefully/I think, doing the same as https://github.com/ssbc/ssb-peer-invites/issues/20 ) and when ssb-peer-invites is doing its indexing it is always after a while crashing on this line https://github.com/ssbc/ssb-peer-invites/blob/master/types.js#L32
some debug stuff i've gotten out of it
the bad
msg
on that line:caps
on that linethe stacktrace
Am I doing something wrong or is this a bug? It feels like ssb-keys should return
false
if it's a bad msg and if I'm doing something wrong it should tell me more about what I'm doing wrong.Was going to guess that
@gslfzChyXwRD4A1iJ5a88gi0JmphVXyQeb77fXXj2mo=.ed25519
was one of my testing accounts but it seems it's @giarc