Skip to content

fix: prevent mobile Safari from caching API responses#2329

Merged
btucker merged 1 commit intomainfrom
fix/mobile-cache-headers
Apr 5, 2026
Merged

fix: prevent mobile Safari from caching API responses#2329
btucker merged 1 commit intomainfrom
fix/mobile-cache-headers

Conversation

@btucker
Copy link
Copy Markdown
Owner

@btucker btucker commented Apr 5, 2026

Summary

Mobile Safari PWA aggressively caches fetch responses, which can cause stale channel history when returning from background. Messages posted by channel leads while the app was backgrounded would not appear on mobile but were visible on desktop.

  • Backend: Added Cache-Control: no-store header to all API responses via tower_http::SetResponseHeaderLayer
  • Frontend: Added cache: "no-store" to fetchHistory and fetchAgentsMd fetch options as defense-in-depth

Test plan

  • cargo clippy clean
  • cargo test — 1534 lib tests pass
  • biome check — 0 errors
  • Manual: open mobile PWA, background it, post a message from desktop, foreground mobile — message should appear

🤖 Generated with Claude Code

Mobile Safari PWA aggressively caches fetch responses, which can cause
stale channel history when returning from background. Messages posted
by channel leads while the app was backgrounded would not appear.

- Backend: add Cache-Control: no-store header to all API responses via
  tower-http SetResponseHeaderLayer
- Frontend: add cache: "no-store" to fetchHistory and fetchAgentsMd
  fetch options as defense-in-depth

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.92%. Comparing base (b47707c) to head (27fa5d3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2329      +/-   ##
==========================================
- Coverage   63.93%   63.92%   -0.02%     
==========================================
  Files         100      100              
  Lines       38578    38581       +3     
==========================================
- Hits        24664    24661       -3     
- Misses      13914    13920       +6     
Files with missing lines Coverage Δ
src/daemon_v2/web/mod.rs 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@btucker btucker merged commit 08fca38 into main Apr 5, 2026
13 checks passed
@btucker btucker deleted the fix/mobile-cache-headers branch April 5, 2026 15:50
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