-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Fix historical event subscriptions when made as first provider request #3455
Conversation
@cgewecke had a short look, but I'll leave conflict resolving to you here (after merging the Websocket Improvement PR), not sure on all changes |
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
}); | ||
}); | ||
}); | ||
|
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.
Nice and clean test setup and procedural structure. Really cool! 👍
this.options.requestManager.send({ | ||
method: 'eth_getLogs', | ||
params: [payload.params[1]] | ||
params: [blockParams] |
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.
Had some broader look at surrounding code blocks, should be side-effects free.
(@cgewecke can you eventually update other outstanding PRs as well? Think this will make the process easier.) |
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.
Reapproval after merge-conflict resolution.
Description
Revival of #3401, targeted at 1.x
Resolves a race condition that arises when the first request made by a Websocket provider is a subscription to an event which includes a request for historical logs.
Web3 was deleting the
fromBlock
parameter made for the historical logs request while the Websocket connection established itself, resulting in the "missing logs" bug reported in #3389.Commit (#3401) 64c1302 is a test that can be seen failing in Travis here
Commit (#3401) 7f3f42b fixes it by copying the params.
The copied params object looks like....
Fixes #3389
Type of change
Checklist:
npm run dtslint
with success and extended the tests and types if necessary.npm run test:unit
with success.npm run test:cov
and my test cases do cover all lines and branches of the added code.npm run build-all
and tested the resulting file/'s fromdist
folder in a browser.CHANGELOG.md
file in the root folder.