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

#set() hangs after some time #26

Closed
juliangruber opened this issue Nov 4, 2019 · 1 comment · Fixed by #28
Assignees
Labels
bug

Comments

@juliangruber
Copy link
Member

@juliangruber juliangruber commented Nov 4, 2019

I have an issue where after some time p2p.set() doesn't return any more. I've attached 2 files for producing this, which need to be run after each other. Sometimes it takes multiple tries of 2.js to reproduce the hanging.

// 1.js
const P2PCommons = require('@p2pcommons/sdk-js')

const main = async () => {
  const p2p = new P2PCommons()
  await p2p.ready()
  const { url } = await p2p.init({ type: 'content', title: 'title' })
  console.log(url)
  await p2p.destroy()
}

main().catch(err => {
  console.error(err)
  process.exit(1)
})
// 2.js
const P2PCommons = require('@p2pcommons/sdk-js')

const main = async () => {
  const p2p = new P2PCommons()
  await p2p.ready()
  const metadata = { url: process.argv[2], title: 'beep' }
  await p2p.set(metadata)
  await p2p.destroy()
}

main().catch(err => {
  console.error(err)
  process.exit(1)
})
$ node 1.js
877375c385447b498ace3ecb93afacc52f978c799cafcaebe1c8d1a2bcb6df4b
$ node 2.js 877375c385447b498ace3ecb93afacc52f978c799cafcaebe1c8d1a2bcb6df4b
$ node 2.js 877375c385447b498ace3ecb93afacc52f978c799cafcaebe1c8d1a2bcb6df4b

Do you know what's going on here?

@juliangruber

This comment has been minimized.

Copy link
Member Author

@juliangruber juliangruber commented Nov 4, 2019

The version is 0.2.5 btw. The same works in 0.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.