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

Update eth-json-rpc-filters #7325

Merged
merged 4 commits into from
Oct 30, 2019
Merged

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Oct 29, 2019

This fixes an eth-json-rpc-filters-related memory leak. Specifically, the subscription manager middleware would not be torn down when a connection was closed, and some listeners would never be removed. That middleware now exposes a destroy function, which will be called by the extension on connection teardown, here:

pump(
outStream,
providerStream,
outStream,
(err) => {
// cleanup filter polyfill middleware
engine._middleware.forEach((mid) => {
if (mid.destroy && typeof mid.destroy === 'function') {
mid.destroy()
}
})
if (err) log.error(err)
}
)
}

Changes

Result

yarn why eth-json-rpc-filters
=> Found "eth-json-rpc-filters@4.1.1"
info Has been hoisted to "eth-json-rpc-filters"
info Reasons this module exists
   - Specified in "dependencies"
   - Hoisted from "gaba#web3-provider-engine#eth-json-rpc-filters"

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rekmarks rekmarks merged commit 5d843db into MetaMask:develop Oct 30, 2019
@rekmarks rekmarks deleted the update-eth-filters branch October 30, 2019 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants