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

bot: route URL callbacks through bot.call() too #1845

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

dgw
Copy link
Member

@dgw dgw commented Apr 14, 2020

Description

With this change, URL callbacks are no longer called outside the enforcement area of rate-limits, per-channel configuration, etc.

See #1812.

I'm initially ignoring the checklist below because I expect @Exirel will look at this Soon™. He'll either use it as a starting point and add tests, or propose an alternative implementation (and add tests).

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@dgw dgw added the Bugfix Generally, PRs that reference (and fix) one or more issue(s) label Apr 14, 2020
@dgw dgw added this to the 7.0.2 milestone Apr 14, 2020
@dgw dgw force-pushed the fix-url-callbacks-bypassing-limits branch from 9dbf92c to be4d7ff Compare April 14, 2020 00:43
sopel/coretasks.py Outdated Show resolved Hide resolved
sopel/bot.py Show resolved Hide resolved
With this change, URL callbacks are no longer called outside the
enforcement area of rate-limits, per-channel configuration, etc.

Plus: Extra debug logging in `bot.call()` for future problems like this.

Thanks to @Exirel for suggesting the decorator solution here!

Co-Authored-By: Florian Strzelecki <florian.strzelecki@gmail.com>
@dgw dgw force-pushed the fix-url-callbacks-bypassing-limits branch from be4d7ff to 2db6f0f Compare April 14, 2020 17:57
@dgw
Copy link
Member Author

dgw commented Apr 14, 2020

@Exirel you earned yourself a co-author tag for that wrapping decorator suggestion. Magnifique!

@dgw dgw marked this pull request as ready for review April 14, 2020 17:59
@dgw dgw requested a review from Exirel April 14, 2020 17:59
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dgw dgw changed the title bot, coretasks: route URL callbacks through bot.call() too bot: route URL callbacks through bot.call() too Apr 15, 2020
@dgw dgw merged commit dc60b80 into 7.0.x Apr 15, 2020
@dgw dgw deleted the fix-url-callbacks-bypassing-limits branch April 15, 2020 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Generally, PRs that reference (and fix) one or more issue(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants