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

Now we can remove the close event #4825

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

antonio-fr
Copy link

and only let disconnect.
Following #4786

Description

Close event can now be removed. It is a deprecated event that is replaced by disconnect.
Type of change

Bug fix (non-breaking change which fixes an issue)

It was just a deprecation warning.

Checklist

[y] I have selected the correct base branch.
[y] I have performed a self-review of my own code.
[y] I have commented my code, particularly in hard-to-understand areas.
[n] I have made corresponding changes to the documentation.
[y] My changes generate no new warnings. And one warning less
[?] Any dependent changes have been merged and published in downstream modules.
[n] I ran npm run dtslint with success and extended the tests and types if necessary.
[n] I ran npm run test:unit with success.
[n] I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
[n] I ran npm run build and tested dist/web3.min.js in a browser.
[n] I have tested my code on the live network.
[n] I have checked the Deploy Preview and it looks correct.
[n] I have updated the CHANGELOG.md file in the root folder.

and only let disconnect.
Following web3#4786
@nazarhussain
Copy link
Contributor

@antonio-fr Please provide some reference for that standard change.

@nazarhussain nazarhussain added Review Needed Maintainer(s) need to review Needs Clarification Requires additional input labels Mar 9, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1941142164

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 286 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+1.8%) to 74.497%

Files with Coverage Reduction New Missed Lines %
packages/web3-core-requestmanager/src/jsonrpc.js 1 70.0%
packages/web3-core-helpers/lib/errors.js 2 79.41%
packages/web3-core-subscriptions/lib/subscription.js 2 90.37%
packages/web3-core-helpers/src/formatters.js 7 85.42%
packages/web3-core-requestmanager/lib/index.js 17 72.89%
packages/web3-core-helpers/src/errors.js 29 1.56%
packages/web3-utils/src/soliditySha3.js 34 3.43%
packages/web3-utils/src/index.js 43 31.38%
packages/web3-utils/src/utils.js 44 9.66%
packages/web3-eth-accounts/src/index.js 107 23.67%
Totals Coverage Status
Change from base Build 1927230259: 1.8%
Covered Lines: 3238
Relevant Lines: 4102

💛 - Coveralls

@antonio-fr
Copy link
Author

As describe in the initial related issue opened, Metamask informs that The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect

This current PR was proposed by @jdevcs who wrote to me in the issue "go ahead and open PR for removing close".

The base working standard is EIP1193. This standard is the new Web3 standard, and it states there's a disconnect event, but no "close" event. The "close" event was deprecated by the PR #2586 in the EIP1193, which deprecated "close" in favor of "disconnect. The EIP1193 since clearly states :
Legacy Events : close (DEPRECATED) This event is superseded by "disconnect".

@jdevcs jdevcs changed the base branch from 1.x to junaid/depEventListener4786 March 10, 2022 17:54
@jdevcs jdevcs merged commit 1bf6859 into web3:junaid/depEventListener4786 Mar 10, 2022
@jdevcs
Copy link
Contributor

jdevcs commented Mar 10, 2022

Many Thanks @antonio-fr for your contribution. Created #4839 as some tests were failing in this PR's github actions.

@jdevcs jdevcs added 1.x 1.0 related issues and removed Needs Clarification Requires additional input Review Needed Maintainer(s) need to review labels Mar 10, 2022
jdevcs added a commit that referenced this pull request Mar 17, 2022
* Now we can remove the close event (#4825)

Following #4786

* Update CHANGELOG.md

Co-authored-by: antonio-fr <7551901+antonio-fr@users.noreply.github.com>
@jdevcs jdevcs mentioned this pull request Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants