fix(cache): --fresh flag now updates cache with fresh response#708
Conversation
The --fresh flag disabled both cache reads AND writes, so subsequent invocations without --fresh still served stale data until TTL expired. Split the bypass into read-only (--fresh flag) vs full disable (SENTRY_NO_CACHE=1 env var) so fresh API responses are written back to cache.
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Docs
Other
Bug Fixes 🐛Dashboard
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
|
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1569 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.30% 95.30% —%
==========================================
Files 229 229 —
Lines 33378 33380 +2
Branches 0 0 —
==========================================
+ Hits 31808 31811 +3
- Misses 1570 1569 -1
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b25f88b. Configure here.

Summary
--fresh(-f) flag calleddisableResponseCache()which set a process-global flag checked by both cache reads and writes, so fresh API responses were discarded instead of updating the cache--freshstill served stale data until the 5-minute TTL expired--freshonly skips cache reads (writes still go through), whileSENTRY_NO_CACHE=1disables both reads and writes