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

Improve clarity of HttpProvider keepAlive value #3463

Merged
merged 6 commits into from
Apr 28, 2020
Merged

Conversation

prestwich
Copy link
Contributor

Don't use a ternary statement on a boolean statement to resolve truthiness. Just double-negate it

Description

Please include a summary of the change and be sure you follow the contributions rules we do provide here

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

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.
  • 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 have executed npm run test:cov and my test cases do cover all lines and branches of the added code.
  • I ran npm run build-all and tested the resulting file/'s 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.

@coveralls
Copy link

coveralls commented Apr 9, 2020

Coverage Status

Coverage remained the same at 88.596% when pulling a7c6156 on prestwich:patch-1 into a510a00 on ethereum:1.x.

@prestwich
Copy link
Contributor Author

@prestwich
Copy link
Contributor Author

The ideal version of this may be const keepAlive = options.keepAlive !== false; but I'm too annoyed by JS to keep thinking about it :D

@ryanio
Copy link
Collaborator

ryanio commented Apr 10, 2020

The ideal version of this may be const keepAlive = options.keepAlive !== false; but I'm too annoyed by JS to keep thinking about it :D

That seems clear and straight-forward to me if you want to update the PR to that :)

Thanks @gnidan for your feedback about the default behavior. @prestwich it might be helpful to others in the future too if you want to add a small comment in the source there (about the default behavior of keepAlive).

@prestwich
Copy link
Contributor Author

Updated the PR, added a comment, and squashed to a single commit

@ryanio ryanio added 1.x 1.0 related issues Refactoring labels Apr 10, 2020
ryanio
ryanio previously approved these changes Apr 10, 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 :)

Edit: actually sorry one last thing, could you add an entry in the changelog noting the update?

@ryanio ryanio changed the title Fix truthiness check Improve clarity of HttpProvider keepAlive value Apr 12, 2020
@cgewecke
Copy link
Collaborator

Updated the changelog in a7c6156

nivida
nivida previously approved these changes Apr 15, 2020
@cgewecke cgewecke self-requested a review April 28, 2020 19:05
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

@cgewecke cgewecke merged commit 5880e69 into web3:1.x Apr 28, 2020
@ryanio ryanio mentioned this pull request May 8, 2020
13 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 Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants