Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

empty Object returns as an error when integrating with js-ipfs #31

Closed
ya7ya opened this issue Sep 17, 2017 · 6 comments
Closed

empty Object returns as an error when integrating with js-ipfs #31

ya7ya opened this issue Sep 17, 2017 · 6 comments

Comments

@ya7ya
Copy link

ya7ya commented Sep 17, 2017

Hey @mkg20001 , Thanks for the cool module, I noticed the following when trying to use this with js-ipfs,

it returns an err when triggering listen , the err is just an empty object {} and I traced it back to the callback function on this.io.emit('ss-join', maStr, pubKeyStr, (err, sig) => {

if you simply ignore that empty object error if (err && Object.keys(err).length !== 0) , it works but i'm not sure thats a proper fix , and also sig returned undefined .

Thanks for your help, I appreciate the hard work 👍

@mkg20001
Copy link
Member

This empty object might be the result of the server returning an error object and JSON.stringify turning it into an empty object.
I will look into the error later.
Btw are you running the latest version on master or npm?

@ya7ya
Copy link
Author

ya7ya commented Sep 18, 2017 via email

@mkg20001
Copy link
Member

I think the error could be caused by using ws-star-signal-1.servep2p.com as it's running an older version of ws-star and using ws-star-signal-3.servep2p.com instead should fix that.
Also are you creating the websocket-star transport with the id as argument (new WStar{ id: peerId }))?

@mkg20001
Copy link
Member

@ya7ya I've solved the empty object bug. Now it should return a string or an error (in the latest git version)

@ya7ya
Copy link
Author

ya7ya commented Sep 22, 2017

@mkg20001 Thanks dude, I'll check it out. and yes I was using the peerId in the constructor as instructed 👍

@mkg20001
Copy link
Member

mkg20001 commented Apr 3, 2018

Should have been fixed. Reopen if it regresses.

@mkg20001 mkg20001 closed this as completed Apr 3, 2018
@ghost ghost removed the ready label Apr 3, 2018
mkg20001 pushed a commit that referenced this issue Jul 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants