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

Throw when requests made after WS reconnect attempts are exhausted #3494

Merged
merged 5 commits into from
May 7, 2020

Conversation

cgewecke
Copy link
Collaborator

@cgewecke cgewecke commented Apr 29, 2020

Description

Addresses #3492.

Requests sent when the connection is dead after max reconnection attempts have been exhausted,
aren't throwing.

The reconnecting flag isn't unset correctly so new requests begin queueing here:

https://github.com/ethereum/web3.js/blob/bcf248f895fe14d466e6fe60e9096f0fc5e7a766/packages/web3-providers-ws/src/index.js#L311-L315

(Opening as a draft pending feedback from #3492 because their expected behavior is different from what's proposed here.)

Fixes #3492

Type of change

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

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.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run test:unit with success.
  • I have updated the CHANGELOG.md file in the root folder.

@cgewecke cgewecke changed the title Issue/3492 maxattempts Throw when requests made after WS reconnect attempts are exhausted Apr 29, 2020
@cgewecke cgewecke marked this pull request as ready for review April 29, 2020 17:18
@cgewecke cgewecke added 1.x 1.0 related issues Bug Addressing a bug Review Needed Maintainer(s) need to review labels Apr 29, 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 for the additional test cases.

@ryanio ryanio merged commit ddd434f into 1.x May 7, 2020
@Polycarpik Polycarpik deleted the issue/3492-maxattempts branch August 12, 2020 16:01
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 Review Needed Maintainer(s) need to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebSocket reconnect doesn't throw error on maxAttempts
2 participants