-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[v6] FetchCancelSignal might have an incorrect assertion #3733
Comments
Ack! I switched a bunch of I’ll get to this right away. Thanks! |
So, the signal being crossed is definitely a bug, but not one that should be affecting your above code. I am able to use your code to get back Network object... |
Oh!! Maybe because you are in the browser? Which uses a different Ok... I'll make the change and push it out, because it is certainly a bug. :) |
This should be fixed in v6.0.2. Try it out and let me know! :) This is also extra incentive to get the Karma tests back up an running, to help detect the browser-specific issues. Thanks! :) |
It's working now! Your fix was incredibly fast and I am so grateful. Thank you so much @ricmoo! |
Ethers Version
6.0.0
Search Terms
provider
Describe the Problem
Hi! Thank you for shipping V6 🥳. Before I submit a pull request, I wanted to confirm if my understanding of the issue is correct. The provider is unable to fetch:
✅ Minimal CodeSandbox demo in v5 (working)
❌ Minimal CodeSandbox demo in v6 (not working)
The error
I tested this locally and received an assertion error from utils/fetch.ts claiming that the signal was cancelled, however it wasn't (
this.#cancelled
was set tofalse
).It's coming from the assertion in
addListener
:The solution
As the
assert
function inverts the check boolean internally, perhaps it should be rewritten in this manner:Here's a live demo of the solution. Here's a CodeSandbox demo of the solution in practice. I copied Ethers v6 from Cloudflare CDN to a local file and adjusted the
addListener
function based on the solution mentioned above.Code Snippet
No response
Contract ABI
No response
Errors
Environment
Browser (Chrome, Safari, etc)
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: