Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Error during node shutdown #222

Closed
achingbrain opened this issue May 13, 2020 · 2 comments
Closed

Error during node shutdown #222

achingbrain opened this issue May 13, 2020 · 2 comments
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@achingbrain
Copy link
Member

I think this might be a similar issue to libp2p/js-libp2p-tcp#130, this time in the browser.

We're in the process of tearing a node down while operations are ongoing - an error is thrown which is not handled. Here simple-peer is trying to add a code property to the thrown value (it looks like a string?) which already has a read-only code property.

ipfs: FAILED TESTS:
ipfs:   interface-ipfs-core tests
ipfs:     .pubsub.peers
ipfs:       ✖ "after all" hook for "should return peers for a topic - multiple peers"
ipfs:         Chrome Headless 81.0.4044.138 (Linux x86_64)
ipfs:       Error: Uncaught TypeError: Cannot assign to read only property 'code' of object '' (file:/home/travis/build/ipfs/js-ipfs/node_modules/simple-peer/index.js:26)
ipfs:  Command failed with exit code 1: karma start /home/travis/build/ipfs/js-ipfs/node_modules/aegir/src/config/karma.conf.js --files-custom --log-level error --bail true --timeout 5000
@vasco-santos vasco-santos added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked labels May 14, 2020
@achingbrain
Copy link
Member Author

I've PR'd simple-peer to not try to override the .code property of the thrown error, this should stop the secondary error from being thrown: feross/simple-peer#660

@achingbrain
Copy link
Member Author

This module doesn't use simple-peer any more, it now uses https://github.com/libp2p/js-libp2p-webrtc-peer

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

2 participants