Skip to content

Rate limit override - #5330

Open
Vamp1reAchao wants to merge 3 commits into
python-telegram-bot:masterfrom
Vamp1reAchao:rate-limit-override
Open

Rate limit override#5330
Vamp1reAchao wants to merge 3 commits into
python-telegram-bot:masterfrom
Vamp1reAchao:rate-limit-override

Conversation

@Vamp1reAchao

Copy link
Copy Markdown

Fix AIORateLimiter handling of rate_limit_args=0.

Previously, passing 0 could be treated as a falsy value and fall back to the configured default retry limit. This change distinguishes an explicitly provided 0 from None, allowing callers to intentionally disable retries for a specific request while preserving the global default behavior when no override is provided.

Includes regression tests covering both explicit 0 and fallback-to-default behavior.

@@ -0,0 +1 @@
bugfixes = "Respect an explicit rate_limit_args=0 in AIORateLimiter"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The file is missing a few more attributes, can you look at the other .tomls and update this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, updated the changelog entry and reverted the unrelated test change. Thanks!

@harshil21 harshil21 Aug 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you also fix the failing prek action? Don't worry about the other failing tests

assert all(task.done() for task in non_chat_tasks.values())
assert all(task.done() for task in chat_tasks.values())
finally:
# cleanup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please revert this

@harshil21 harshil21 added contrib: safe for tests Add this label to contributor PR's to run tests. Must be re-added for every commit to run tests on. 🔌 bug pr description: bug labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔌 bug pr description: bug contrib: safe for tests Add this label to contributor PR's to run tests. Must be re-added for every commit to run tests on.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants