-
Notifications
You must be signed in to change notification settings - Fork 254
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
Stabilise the unstable-reconnecting-rpc-client
#1677
Comments
Yes, I can confirm that this is the roadmap |
I've encountered some issues with testing The ExplanationThe Mocking the RpcClientUsing concrete implementation of
Mocking the ServerSeems like an overkill to me as this will require us to start up and kill a test server for every test and any additional wins in testing would be for In short:i'd prefer to go with testing the
|
Thanks for the writeup and indeed mocking the RpcClient sounds good enough for this if it's possible to test reconnect on block subscriptions and similar on but it's important to test both the legacy and unstable backend because they differ a bit. As we already discussed, I'm completely fine to add Serialize/Deserialize for the types in the backend as a first step to see how it will look. It should be quite easy to feature-gate those if needed but would be good to see how it will look like and hard to tell for me right now without any code... Thus, mocked RPC client test in combination with the integration test in #1711, seems like a reasonable acceptance level. I wrote some unit tests for the finalized block subscriptions for the unstable backend that it's probably the only tests we got so far, https://github.com/paritytech/subxt/blob/master/subxt/src/backend/unstable/follow_stream_driver.rs#L650-#L745. FYI, the actual behavior between the unstable backend and legacy differs where we don't keep track of missed blocks for the legacy one i.e, we just emit a notification on the subscription that the connection was lost whereas for the unstable we actually keep track of whether a block was missed or not.. |
I agree with the above too offhand! Mocking the RpcClientT and then either using hand written JSON or (if that is a pain) adding Serailize attrs behind the test attr makes sense to me! |
We'd like to stabilise the automatic reconnecting logic and make it the default behaviour.
I think that this requires two things:
Once these are done and we have some confidence that it works, we can make this the default and remove the feature flag entirely. Maybe we should continue exposing the "not reconnecting" jsonrpsee client too in case people want to fall back to the old behaviour or handle reconnecting in some other way.
The text was updated successfully, but these errors were encountered: