-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Nikos/5835/websocket provider keeps important error message back #5884
Nikos/5835/websocket provider keeps important error message back #5884
Conversation
Pull Request Test Coverage Report for Build 4344683272
💛 - Coveralls |
jdevcs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also changelog update is required
| this.connection.addEventListener('close', this._onClose.bind(this)); | ||
| }; | ||
| if(this.connection._connection){ | ||
| this.connection._client.removeAllListeners('connectFailed'); //Override the internal listeners, so they don't trigger a `close` event. We want to trigger `_onClose` manually with a description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As browsers use the native WebSocket object + doesn't use/have ws lib client and node uses ws client. so can we more specifically check _client here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And do we also need to handle the same for the browser WebSocket? Or is it only an issue that we need to handle just for node?
avkos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…-error-message-back
Description
closes #5835
Checklist for 1.x:
npm run dtslintwith success and extended the tests and types if necessary.npm run test:covand my test cases cover all the lines and branches of the added code.npm run buildwith success.dist/web3.min.jsin a browser.CHANGELOG.mdfile in the root folder.