-
-
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
Unreliable event filtering #613
Comments
Do you mean the event is never happening? What backend are you using (Geth, Ganache, Parity, INFURA) and which network (homestead, dev)? I'm not familiar with jest, what is the purpose of |
The I have only tested the linked repository against ganache. The event happens, and as the |
Is there any update on this? We're at the point in the state channels project where this becomes a real issue, not just in testing: if
then the first event filter might cause the second filter to not work properly. What seems to be worse is, even in the case where there is just one filter, it doesn't always seem to catch the proper event emitted when there are multiple events of the same type emitted. Here's an example which fails for me, in the same repository linked above. |
Looking more into this now. @yuetloo reproduced it on her machine, so I'll be creating a simple test on my machine to test this too... |
We are still investigating, and plugging Thanks for your patience. :) |
Thanks @ricmoo! |
Huge thanks to @yuetloo for all her efforts in debugging this. A fix has been added, and the tests are running, after they pass (usually about an hour) I will publish to NPM and update this ticket. This has identified a few other quirks with events, which I'm addressing right now with the re-write of the v5 events. Thanks! |
Please update to Thanks! :) |
After upgrading to |
@ricmoo doesn't this break the usecase where a user wants to register several filters before doing the initial poll? In our case (at raiden light-client), to catch up after the user was offline for a while, we've been setting the block with |
@andrevmatos I don't think it should. Does it for you? The call to Let me know if not though. One change I do notice I should add though, is to add a |
@ricmoo It seems to be working fine here on the e2e tests, thank you. But finer control over when the polling happens, since there may be a lot in between, would be useful. Maybe prevent it from auto-starting if it was explicitly disabled by the user, or some special value to indicate that? Anyway, the |
The cookbook provides a strategy for testing events, using
contract.on
. However, this only seems to be reliable if run in a single test suite.A separate part of the cookbook presents a strategy for returning a value from a state-changing function. This strategy can also be used to test events.
Going by the cookbook, we at Magmo used the first strategy. However, it forced us to run our jest test suites in serial with the
--runInBand
option. This is both time consuming, and worrying, since we cannot trust the behaviour ofcontract.on
based on this issue.Here is a repository reproducing the issue. On the first commit,
yarn test
will not work, butyarn testInBand
will reliably work. On the second commit,yarn test
will reliably work.The text was updated successfully, but these errors were encountered: