-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Check for duplicate queue entries in WebsocketProvider #3576
Conversation
|
Tangentially, had a thought that your use case might also be helped by using yarn's selective version resolutions feature. This lets you coerce all instances of a package in the dependency tree to a single version, flat-packed once at the outer level. We use it here in E2E testing with projects that consume Web3 via truffle-contract. You add the following key to your package.json and install with yarn: "resolutions": {
"*/**/web3": "1.2.8",
"*/**/web3-bzz": "1.2.8",
"*/**/web3-core-helpers": "1.2.8",
"*/**/web3-core-method": "1.2.8",
"*/**/web3-core-promievent": "1.2.8",
"*/**/web3-core-requestmanager": "1.2.8",
"*/**/web3-core-subscriptions": "1.2.8",
"*/**/web3-core": "1.2.8",
"*/**/web3-eth-abi": "1.2.8",
"*/**/web3-eth-accounts": "1.2.8",
"*/**/web3-eth-contract": "1.2.8",
"*/**/web3-eth-ens": "1.2.8",
"*/**/web3-eth-iban": "1.2.8",
"*/**/web3-eth-personal": "1.2.8",
"*/**/web3-eth": "1.2.8",
"*/**/web3-net": "1.2.8",
"*/**/web3-providers-http": "1.2.8",
"*/**/web3-providers-ipc": "1.2.8",
"*/**/web3-providers-ws": "1.2.8",
"*/**/web3-shh": "1.2.8",
"*/**/web3-utils": "1.2.8"
},Nested Web3 dependencies will be installed at 1.2.8. You can check this by running Another detail is that @truffle/contract automatically attaches a confirmation handler to each request which fires 24X by default. Setting Side-note: if you're interested in running the ganache tests locally you can with To run against geth w/ websocket tests included (takes ~3 min) |
|
@cgewecke Thanks for the pointers! |
Understandable, although the interaction bug you discovered here with multiple versions installed is pretty bad. FWIW we use resolutions in testing here to inject the latest state of the lib into another project and run their units tests with it. So there's at least some ongoing validation that Web3 works with @truffle/contract. Would not pretend it's exhaustive though. |
That comes as a bit of a surprise, looking at the failure of this PR, where a using project breaks absent changes in the using project following an attempt to upgrade a patch-level web3 change. (The interaction issues are not all old ones!) However, it's nice to hear there's some attempts to continue compatibility checking. |
|
That PR is not getting past a typescript compilation step on install. Think it's something that could be resolved if they reworked their TS a bit. We've continued to make sure the core logic doesn't break @truffle/contract since that module is widely used on it's own. We're also trying to make sure that Web3's types changes are non-breaking by testing the latest state against a production TS project (gnosis/dex-react) here. Lastly, there's a tracking issue at truffle 2688 that documents the main things Truffle would need to address to upgrade Web3. |
|
This PR has been automatically marked as stale beacause it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
|
I don't think this should be autoclosed; I think it could benefit from some collaborative effort to get it over the finish line. |
|
This PR has been automatically marked as stale beacause it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
|
I still don't think this should be marked as stale. |
|
This PR has been automatically marked as stale beacause it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
|
I still don't think this should be autoclosed; I think it could benefit from some collaborative effort to get it over the finish line. |
|
|
|
I don't remember the CLA requirement being part of the deal when taking over from the Ethereum Foundation. |
|
Please see #3846 . CLA is not required. |
|
This PR is still WIP and there is no activity, so closing . @wbt feel free to reopen this when you have time for contributions. Thanks |
Description
This is intended to address the issue found in #3568 by detecting the condition causing that issue, and emitting an error instead of sending data to incorrect formatters and callbacks. This error will not be emitted in cases where intended operation can continue because only ids that have already been fully used and deleted from queues are being reused, as the existing behavior is not specifically problematic in that case, though this may lead some bugs to go undiscovered in light testing.
I have marked this as a draft because in limited testing with the example code of #3573, this does not produce helpful output such as the text of the error message; execution just silently stops and it's not clear why. If someone else can do more testing or edits to make that clearer, that would be helpful.
A corresponding change in 2.x might be a good idea.
Fixes #3568
Type of change
I am not sure if this should be considered a bug fix or breaking change. It would only break code in cases where the code is already broken but where an existing issue might not be evident, making the issue more evident.
Checklist:
This is as complete as of initial PR submission as the original submitter will get it:
npm run dtslintwith success and extended the tests and types if necessary.npm run test:unitwith success.npm run test:covand my test cases cover all the lines and branches of the added code.npm run build-alland tested the resulting files fromdistfolder in a browser.CHANGELOG.mdfile in the root folder.