-
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
rumqttc: Fix: subscribe_many cannot work as implemented, always causing EmptySubscription error. #882
Conversation
Thanks for the PR! any particular reason to move validation of filters from client.rs to mqttbytes? |
In order to not consume the iterator, validation had to happen on the finished After I did this for |
Or is this an architectural concern? Something like |
kinda yes. Anyways if subscribe.filters.is_empty() || subscribe.filters.iter().any(invalid) {
reuturn Err;
}
// process normally wdyt? open to discussion! |
Three ideas:
|
for now i think 3 ( or if not it then 2 ) will work out best :) |
3b9ff0c
to
db404f0
Compare
I've pushed an update that implements 2. |
db404f0
to
18ef345
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 Thanks for the fix!
Pull Request Test Coverage Report for Build 9642819082Details
💛 - Coveralls |
Type of change
Bug fix (non-breaking change which fixes an issue)
Checklist:
cargo fmt
CHANGELOG.md
if it's relevant to the users of the library. If it's not relevant mention why.main
and hasn't found it's way into a release yet.Notes
This fixes the issue with
subscribe_many
as detailed in #837.I know that that PR was closed in favor of #813 but that apparently didn't go anywhere for months so I suggest to merge a smaller scoped fix in the meantime. This might also prevent others like me from having to search for this Bug for hours just to find out it was already known and had a fix that just wasn't merged.
To recap: The issue is that
subscribe_many
consumes the iterator over topics in order to validate them, leaving no actual topics left to subscribe to. This then always leads to anEmptySubscription
error in theEventLoop
.