ssbc / ssb-peer-invites

A new ssb invite system to create invites without having a pub
MIT License
26 stars 2 forks source link

Error: cb called twice from local api #10

Open cryptix opened 5 years ago

cryptix commented 5 years ago

okay changed module name and reinstalled. now I get this crash on the sbot that tries to open the invite:

/Users/cryptix/ssb/scuttle-shell/node_modules/ssb-server/node_modules/packet-stream/index.js:162
        if(once) throw new Error('cb called twice from local api')
                 ^

Error: cb called twice from local api
    at /Users/cryptix/ssb/scuttle-shell/node_modules/ssb-server/node_modules/packet-stream/index.js:162:24
    at /Users/cryptix/ssb/scuttle-shell/node_modules/ssb-server/node_modules/muxrpc/stream.js:45:22
    at next (/Users/cryptix/ssb/scuttle-shell/node_modules/ssb-peer-invites/index.js:435:9)
    at /Users/cryptix/ssb/scuttle-shell/node_modules/ssb-peer-invites/index.js:418:13
    at Object._requests.(anonymous function) (/Users/cryptix/ssb/scuttle-shell/node_modules/packet-stream/index.js:38:5)
    at PacketStream._onrequest (/Users/cryptix/ssb/scuttle-shell/node_modules/packet-stream/index.js:151:26)
    at PacketStream.write (/Users/cryptix/ssb/scuttle-shell/node_modules/packet-stream/index.js:134:41)
    at /Users/cryptix/ssb/scuttle-shell/node_modules/muxrpc/pull-weird.js:56:15
    at /Users/cryptix/ssb/scuttle-shell/node_modules/pull-stream/sinks/drain.js:24:37
    at /Users/cryptix/ssb/scuttle-shell/node_modules/pull-goodbye/node_modules/pull-stream/throughs/filter.js:17:11
cryptix commented 5 years ago

I manually altered the pubs array and then it worked.. Sorry that I don't know what procuded this.

dominictarr commented 5 years ago

well, the stack trace goes through: https://github.com/ssbc/ssb-peer-invites/blob/master/index.js#L435 and https://github.com/ssbc/ssb-peer-invites/blob/master/index.js#L418

it could be a problem in connectFirst https://github.com/ssbc/ssb-peer-invites/blob/master/index.js#L378-L404 that looks like correct (only callback exactly once) code to me though.