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

Add undefined callback check to websocket provider response queue #3574

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

wbt
Copy link
Contributor

@wbt wbt commented Jun 8, 2020

Defensive programming per last sentence of paragraph 8 in #3573 (comment).

The now-doubled call to .get(id) seems like it might be a little inefficient. I'm not sure how that compares to calling .get(id) once and assigning the result a temporary variable in terms of efficiency, but if someone wants to put some rigor into that selection it'd be helpful.

I don't believe that any corresponding documentation changes are necessary.

A corresponding change in 2.x might be a good idea.

Description

Fixes #3573

Type of change

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

Checklist:

This is as complete as of initial PR submission as the original submitter will get it:

  • 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.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build-all and tested the resulting files from dist folder in a browser.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have tested my code on the live network.
  • The browser visual inspection check looks ok: sudden-playground.surge.sh

Defensive programming per last sentence of paragraph 8 in web3#3573 (comment)
@coveralls
Copy link

coveralls commented Jun 8, 2020

Coverage Status

Coverage increased (+0.003%) to 89.858% when pulling a182d7a on wbt:patch-1 into 076fd46 on ethereum:1.x.

@wbt
Copy link
Contributor Author

wbt commented Jun 8, 2020

For what it's worth, I don't think the failing tests or timeout are related to this commit, nor do I think this commit can be accurately credited with an increase in test coverage.

@cgewecke cgewecke self-requested a review June 9, 2020 01:16
Copy link
Collaborator

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @wbt.

@ryanio ryanio added 1.x 1.0 related issues Bug Addressing a bug labels Jun 9, 2020
@ryanio ryanio changed the title Add undefined check Add undefined callback check to websocket provider response queue Jun 9, 2020
Copy link
Collaborator

@ryanio ryanio left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@cgewecke cgewecke merged commit 4558b27 into web3:1.x Jun 19, 2020
@wbt wbt deleted the patch-1 branch June 19, 2020 21:58
@ryanio ryanio mentioned this pull request Jul 9, 2020
14 tasks
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 Bug Addressing a bug
Projects
None yet
4 participants