Skip to content

Conversation

@Krukov
Copy link
Owner

@Krukov Krukov commented Oct 11, 2025

fir for #382

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.12%. Comparing base (64edb6f) to head (e22d2a7).
⚠️ Report is 3 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #383   +/-   ##
=======================================
  Coverage   94.12%   94.12%           
=======================================
  Files          54       54           
  Lines        3593     3594    +1     
  Branches      460      460           
=======================================
+ Hits         3382     3383    +1     
  Misses        134      134           
  Partials       77       77           
Flag Coverage Δ
unittests 94.04% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Krukov Krukov merged commit cec6427 into master Oct 11, 2025
6 checks passed
Rajat-Ahuja1997 added a commit to Rajat-Ahuja1997/cashews that referenced this pull request Nov 11, 2025
This fixes a regression introduced in version 7.4.2 (commit a47f8ce) where
ControlMixin's __disable ContextVar was changed from having a default value
to using an explicit .set() call. This broke cross-context usage patterns
like FastAPI's lifespan, where cache.setup() is called in one async context
and cache operations happen in different contexts (HTTP requests).

The issue is identical to Krukov#382, which was fixed for key_context.py in PR Krukov#383
(commit e22d2a7), but the same fix was not applied to ControlMixin.

Changes:
- Restore default=set() parameter to ControlMixin.__disable ContextVar
- Remove redundant self.__disable.set(set()) call
- Add test_control_mixin_cross_context to verify cross-context behavior

This ensures that .get() returns a default value in all async contexts,
not just the one where .set() was called, preventing LookupError.
@Krukov Krukov deleted the fix-382 branch December 6, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants