Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5382
Passing
0or0.0toclear_callback_datacurrently clears all cached keyboard data, although the equivalent UTC epoch datetime applies the documented "older than" cutoff. This can discard keyboards that are newer than the supplied cutoff.Check
time_cutoff is Nonebefore clearing the entire mapping. Numeric zero then follows the existing timestamp comparison path. The public API, datetime conversion, andclear_callback_queries()behavior remain unchanged.Add a parametrized regression test for integer zero, float zero, UTC epoch datetime, explicit
None, and a future timestamp. The fixture includes entries before, exactly at, and after the epoch, and checks that callback-query IDs are preserved. Existing tests continue covering omitted cutoffs, query-ID clearing, and positive timestamp/timezone conversion.Validation on CPython 3.12.13, with sockets disabled:
The two expected failures on the original source are the integer-zero and float-zero regression cases. The skipped tests concern running without the optional callback-data dependency, which is installed for this run. No Telegram requests are needed.
Changed-file checks also pass using the versions pinned in
.pre-commit-config.yaml: Ruff 0.16.8 lint and formatting, Mypy 1.20.2, and Pylint 4.1.3 (the latter on CPython 3.14.6, as required by its hook). These tools were invoked directly; no hooks were installed.Checklist:
The repository's Chango workflow creates the changelog fragment for a PR. Suggested bug-fix note: "Fixed
CallbackDataCache.clear_callback_datatreating a zero UNIX timestamp cutoff as a request to clear all keyboard data."AI disclosure: Codex assisted with part of the code and this description.