-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Rate limiting can be incorrectly applied to callables with no limit set #2627
Comments
Did some bisecting, with It turns out, the Another thing that's changed, and might be relevant, is that I've done some more playing around with debug prints in various places, inspecting the control flow both at
The main issue, I think, is that Sopel tries to rate-limit callables that aren't supposed to be rate-limited. I've gotten lost in the little flowers at the base of one single tree in a forest of thousands, metaphorically speaking, but the Sopelunk through some of this logic was interesting… * — I had to |
Had a good chat about this with @Exirel just now, and I think we're on the way to solving this. Things did indeed get a little muddled during development of #2434 but we can definitely un-muddle them! Starting with using the Rule's checks for whether it's rate-limited, instead of asking the RuleMetrics directly. |
Found the issue and the fix. See the related PR! |
I was trying to figure out why I could get multiple URLs to trigger the same plugin callable, but other people in the channel couldn't.
Turns out, I'm a bot admin, and I'm exempt from rate limiting. The others are not.
Digging deeper, I went to
bot.Sopel.rate_limit_info()
and added some debug logging to the if/elif/elif/else block:Sure enough, if I joined a test channel as my plebeian alter ego and sent three links that would trigger this callable, only one of them triggered the plugin, and two debug messages got logged:
That seems pretty obviously wrong. For reference, the plugin callable's decorators are:
No rate limits to be seen anywhere, so why is this getting blocked? That's the mystery to solve.
Version notes
Tested with 17d46b7 (something else I'm working on fixing), but should still reproduce identically on current
master
orv8.0.0
tag/PyPI release 8.0.0.The text was updated successfully, but these errors were encountered: