Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
The old re-subscription logic was wrong and re-subscribing when the topic didn't change (see log in attached issue). I didn't step through the old code to figure out what the issue was because it was quite messy and hard to understand. But I suspect it's two things combined:
Instead, I rewrote the code to be (I think) easier to understand using some nice attr data classes.
Using some quick testing I was able to confirm that the issue is resolved with this.
Also, the tests seem to be incorrect. I manually stepped through them and couldn't understand why the previous checks were there. The new comparisons look more correct to me when manually stepping through.Nevermind (the tests are way too long and should probably be split up at some point)(if there's another patch release, it would be great to include it there)
Related issue (if applicable): fixes #18909
Checklist:
tox
. Your PR cannot be merged unless tests passCC: @emontnemery @balloob