You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The implementation which does seem to want it can be found here but the first parameter has an effective default value of 1000 and the second is only passed on to this.connection.close() which is implemented here. That implementation only passes it on to this._connection.close() and as seen by parameterless calls to the same function two lines below each two-parameter call, those are optional.
Type of change
Bug fix (non-breaking change which fixes an issue)
Checklist:
I have selected the correct base branch.
I have performed a self-review of my own code.
I have commented my code, particularly in hard-to-understand areas. [This does not seem necessary for this simple 2-character change.]
I have made corresponding changes to the documentation. [The function isn't documented so no changes are needed; this brings the typing more in line with documentation that already does exist.]
My changes generate no new warnings.
Any dependent changes have been merged and published in downstream modules. [There aren't any.]
I ran npm run dtslint with success and extended the tests and types if necessary.
I ran npm run test:unit with success. [Noting that the tests are unreliable on the base branch.]
I ran npm run test:cov and my test cases cover all the lines and branches of the added code. [This command's use of semicolons instead of ampersands mean this superset of the line above has been broken for years. Fixing it here seems unnecessary: Existing test cases cover the change, or would if they were TypeScript, but changing that is beyond the scope of this PR.]
I ran npm run build with success.
I have tested dist/web3.min.js in a browser. [This doesn't make changes in compiled code.]
I have tested my code on the live network. [This doesn't make changes in compiled code.]
I have checked the Deploy Preview and it looks correct. [I'm not sure what this refers to or how to do this; further instructions could be helpful.]
I have updated the CHANGELOG.md file in the root folder.
The failure is 'Failed to connect to Infura over websockets after 10 tries' which I don't think is a consequence of this very minor PR; it seems more likely to be an issue at Infura related to some connectivity issues they've been having lately. Also, I'm not sure if the IP address being used for the test is in the range of newly censored IP addresses intentionally blocked from connecting to Infura, or one of those adjacent to it in some way that leads it to get caught up in the block.
The post about test code coverage changing is also inaccurate. This PR shouldn't change test coverage, and doesn't even touch the files cited as having new missed lines.
Thought it is an improvement worth merging in, the extra change was intended just to kick off the CI again because I don't have permission to do that directly, and note that the tests are unreliable when run locally. It produced the same issue, which I think is an Infura or testing infrastructure issue rather than a bug newly added in the branch proposed for merging.
* Make disconnect params optional in types
* Update changelog, including PR number
* Update refs to old discussions,
mostly just to kick off CI again.
* PR under 1.7.2
Co-authored-by: wbt <[email protected]>
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Though the
disconnectfunction isn't documented, in practice it does not seem to require two params, and the main example given omits them. The second is absent in multiple tests. Both are absent in other tests.The implementation which does seem to want it can be found here but the first parameter has an effective default value of
1000and the second is only passed on tothis.connection.close()which is implemented here. That implementation only passes it on tothis._connection.close()and as seen by parameterless calls to the same function two lines below each two-parameter call, those are optional.Type of change
Checklist:
npm run dtslintwith success and extended the tests and types if necessary.npm run test:unitwith success. [Noting that the tests are unreliable on the base branch.]npm run test:covand my test cases cover all the lines and branches of the added code. [This command's use of semicolons instead of ampersands mean this superset of the line above has been broken for years. Fixing it here seems unnecessary: Existing test cases cover the change, or would if they were TypeScript, but changing that is beyond the scope of this PR.]npm run buildwith success.dist/web3.min.jsin a browser. [This doesn't make changes in compiled code.]CHANGELOG.mdfile in the root folder.