Skip to content

fix: cover recipes/kitchens in low-volatility cache refresh - #352

Merged
touchthesun merged 1 commit into
mainfrom
fix/refresh-recipes-kitchens-cache
Aug 12, 2026
Merged

fix: cover recipes/kitchens in low-volatility cache refresh#352
touchthesun merged 1 commit into
mainfrom
fix/refresh-recipes-kitchens-cache

Conversation

@touchthesun

Copy link
Copy Markdown
Contributor

Summary

Diagnosed why the cooking-test instance still showed "No recipes yet" in
the browser after #350/#351 fixed the backend: it's a client-side cache
issue, not a backend regression.

  • RecipeListView/KitchenListView query under ["recipes"]/["kitchens"],
    persisted to localStorage with a 1h staleTime (see queryClient.ts).
  • Neither key was in LOW_VOLATILITY_QUERY_KEYS, so the "Refresh data"
    control (NavBar) had no way to invalidate a recipes result a browser had
    already cached from before the backend fix -- it would keep serving the
    stale empty list until the 1h staleTime elapsed on its own.
  • Confirmed directly against the deployed backend (curl .../v1/api/okh/recipes)
    that all 3 recipes are returned correctly; the gap is purely this
    browser-side cache never being told to refetch.

Fix

Add ["recipes"] and ["kitchens"] to LOW_VOLATILITY_QUERY_KEYS, so
clicking "Refresh data" invalidates and refetches them like the other
low-volatility datasets (OKH manifests, OKW facilities, packages).

Test plan

  • npx vitest run src/queryClient.test.ts -- covers LOW_VOLATILITY_QUERY_KEYS generically, passes with the new keys
  • npm run test:unit -- 338 tests pass
  • npm run typecheck -- clean

Made with Cursor

Recipe.is_cooking_recipe() started returning real recipes after #350/#351,
but the cooking-test instance's Recipe browse page kept showing "No
recipes yet": RecipeListView/KitchenListView query under queryKey
["recipes"]/["kitchens"], persisted to localStorage with a 1h staleTime,
and neither key was in LOW_VOLATILITY_QUERY_KEYS -- so the "Refresh data"
control in NavBar had no way to invalidate the empty result a browser
had already cached from before the backend fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
@touchthesun
touchthesun merged commit 5f1837b into main Aug 12, 2026
7 checks passed
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.

2 participants