renderer: a read that asks for fresh data, or any read after a mutation, no longer answers from the 1s GET dedupe cache - #142
Open
kai-openswarm wants to merge 1 commit into
Conversation
…on, no longer answers from the 1s GET dedupe cache The fetch interceptor dedupes identical GETs through a 1s response cache. Two cases must never be served from it: a caller that said cache: 'no-store' / 'reload' (it wants the network), and any GET after a mutation that may have changed what it reads. Neither was honoured, so Settings > Memory could add a fact and immediately refetch the list into the pre-save copy cached by its own mount fetch, showing "Nothing saved yet" for a fact the store already held until the panel was reopened. Now no-store/reload bypasses both the cache and an in-flight join, and every successful mutation clears the GET cache (it is a burst dedupe, not a store; the cost is at most one extra round trip per URL). Policy lives in a pure module with a node test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 18, 2026
Open
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.
What
The renderer's fetch interceptor (
frontend/src/shared/config.ts) dedupes identical GETs to the local API through a 1 s response cache. Two cases must never be answered from it, and neither was:cache: 'no-store'/'reload') — it now bypasses the cache and an identical in-flight request;The policy lives in a small pure module (
getCachePolicy.ts) with anode --testfile, so it is testable without a window.Why (user-visible)
Settings › Memory: add a fact within about a second of opening the tab and the list stays on "Nothing saved yet" even though the store already holds the fact — the panel's post-save
refresh()GET was served from the panel's own mount GET, cached moments earlier. Reopening the tab showed it. Any panel that mounts, mutates, and refetches the same URL inside a second has the same hole.How it was verified
node --test frontend/src/shared/getCachePolicy.test.ts(2 tests) andtsc --noEmitclean.No behaviour change for default reads: bursts of identical GETs (twenty cards mounting) still dedupe exactly as before.