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

Take disabled status of CachedSession for CacheActions #183

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

netomi
Copy link
Contributor

@netomi netomi commented Oct 2, 2023

This fixes #182 .

The proposed fix takes the disabled status of the CachedSession into account when the necessary CacheActions are determined from the request. I tried to follow the existing logic which already includes skip read / write. This could also be solved differently, but I would consider this to be a clean solution.

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (0b56f76) 96.87% compared to head (008428d) 97.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
+ Coverage   96.87%   97.20%   +0.33%     
==========================================
  Files          10       10              
  Lines         927      931       +4     
  Branches      168      170       +2     
==========================================
+ Hits          898      905       +7     
+ Misses         18       15       -3     
  Partials       11       11              
Files Coverage Δ
aiohttp_client_cache/backends/base.py 96.77% <ø> (ø)
aiohttp_client_cache/cache_control.py 98.27% <100.00%> (+0.03%) ⬆️
aiohttp_client_cache/session.py 97.87% <100.00%> (+6.76%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JWCook JWCook added this to the v0.10 milestone Oct 2, 2023
@JWCook JWCook added the bug Something isn't working label Oct 2, 2023
@JWCook JWCook merged commit bdc2254 into requests-cache:main Oct 2, 2023
8 checks passed
@netomi netomi deleted the fix-disabled-cache branch October 3, 2023 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CachedSession does not correctly bypass the cache when caching is disabled via session.disabled()
2 participants