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

[ws client]: ChannelClosed message should embed request_id #169

Closed
niklasad1 opened this issue Dec 1, 2020 · 0 comments
Closed

[ws client]: ChannelClosed message should embed request_id #169

niklasad1 opened this issue Dec 1, 2020 · 0 comments

Comments

@niklasad1
Copy link
Member

When a subscription is closed, all the subscriptions are iterated over and returns once a closed subscription is found, which is inefficient and could close the wrong subscription if "several are closed at the same time", see https://github.com/paritytech/jsonrpsee/blob/v2/src/client/ws/client.rs#L303-#L309

Thus, it would be better to just have ChannelClosed(RequestId) than it could be performed in constant time and is correct.

niklasad1 added a commit that referenced this issue Dec 1, 2020
niklasad1 added a commit that referenced this issue Dec 2, 2020
* fix(ws client): embed request id SubscriptClosed

Fixes #169

* Update src/client/ws/client.rs

* Update src/client/ws/client.rs

Co-authored-by: David <[email protected]>

* Update src/client/ws/client.rs

Co-authored-by: David <[email protected]>

Co-authored-by: David <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant