fix: raise TypeError from cache_clear() on async functions#51
Closed
fix: raise TypeError from cache_clear() on async functions#51
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- bytes 1.10.1 → 1.11.1 (RUSTSEC-2026-0007: integer overflow in BytesMut::reserve) - filelock 3.20.1 → 3.24.3 (GHSA-qmgc-5h2g-mvrw: TOCTOU symlink vuln) - orjson 3.11.4 → 3.11.7 (GHSA-hx9q-6w63-j58v: unbounded recursion) - pip 25.3 → 26.0.1 (GHSA-6vgw-5pg2-w6jp: path traversal in wheel extraction) - test_ttl_enforced: increase TTL 1s→3s to prevent CI timing flakiness
cache_clear() called ainvalidate_cache() without awaiting, silently discarding the coroutine. The cache was never actually cleared. Now raises TypeError directing users to await fn.ainvalidate_cache(). Closes #49
3560cec to
16dca07
Compare
Contributor
Author
|
Superseded by combined fix PR |
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.
Summary
cache_clear()on async-decorated functions calledainvalidate_cache()without awaiting, silently discarding the coroutine — cache was never clearedTypeErrordirecting users toawait fn.ainvalidate_cache()Test plan
test_cache_clear_raises_type_error_for_async_function— verifies TypeError is raisedtest_cache_clear_error_message_suggests_ainvalidate— verifies error messagetest_cache_clear_does_not_raise_for_sync_function— sync regression guardtest_async_ainvalidate_cache_still_works— async path still worksCloses #49