Skip to content

fix(cache): --fresh flag now updates cache with fresh response#708

Merged
BYK merged 1 commit intomainfrom
fix/fresh-flag-cache-write
Apr 9, 2026
Merged

fix(cache): --fresh flag now updates cache with fresh response#708
BYK merged 1 commit intomainfrom
fix/fresh-flag-cache-write

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 9, 2026

Summary

  • The --fresh (-f) flag called disableResponseCache() which set a process-global flag checked by both cache reads and writes, so fresh API responses were discarded instead of updating the cache
  • Subsequent invocations without --fresh still served stale data until the 5-minute TTL expired
  • Split the bypass: --fresh only skips cache reads (writes still go through), while SENTRY_NO_CACHE=1 disables both reads and writes
  • Added tests for the new behavior: fresh writes succeed, round-trip stale→fresh→cached works

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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Docs

  • Deploy main branch preview alongside PR previews by BYK in #707
  • Enable sourcemap upload, releases, and environment tracking by BYK in #705

Other

  • (commands) Add buildRouteMap wrapper with standard subcommand aliases by BYK in #690
  • (config) Support .sentryclirc config file for per-directory defaults by BYK in #693
  • (init) Add fuzzy edit replacers and edits-based apply-patchset by betegon in #698
  • (install) Add SENTRY_INIT env var to run wizard after install by betegon in #685
  • (release) Surface adoption and health metrics in list and view (Add release command group with adoption/health subcommand #463) by BYK in #680

Bug Fixes 🐛

Dashboard

  • Add --layout flag to widget add for predictable placement by BYK in #700
  • Render tracemetrics widgets in dashboard view by BYK in #695

Other

  • (build) Enable sourcemap resolution for compiled binaries by BYK in #701
  • (cache) --fresh flag now updates cache with fresh response by BYK in #708
  • (init) Narrow command validation to actual shell injection vectors by betegon in #697
  • (init,feedback) Default to tracing only in feature select and attach user email to feedback by MathurAditya724 in #688
  • (setup) Handle read-only .claude directory in sandboxed environments by BYK in #702

Internal Changes 🔧

  • (docs) Gitignore generated command docs, extract fragments by BYK in #696
  • (eval) Replace OpenAI with Anthropic SDK in init-eval judge by betegon in #683
  • (init) Use markdown pipeline for spinner messages by betegon in #686
  • Regenerate skill files and command docs by github-actions[bot] in 584ec0e0

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-708/

Built to branch gh-pages at 2026-04-09 18:23 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1569 uncovered lines.
✅ Project coverage is 95.3%. Comparing base (base) to head (head).

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

@BYK BYK marked this pull request as ready for review April 9, 2026 18:28
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

@BYK BYK merged commit a758710 into main Apr 9, 2026
25 checks passed
@BYK BYK deleted the fix/fresh-flag-cache-write branch April 9, 2026 18:39
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.

1 participant