fix: prevent mobile Safari from caching API responses#2329
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Cache-Control: no-storeheader to all API responses viatower_http::SetResponseHeaderLayercache: "no-store"tofetchHistoryandfetchAgentsMdfetch options as defense-in-depthTest plan
cargo clippycleancargo test— 1534 lib tests passbiome check— 0 errors🤖 Generated with Claude Code