Skip to content

fix(search): invalidate runtime caches when config changes#387

Open
SaitejaKommi wants to merge 1 commit intoopenfoodfacts:mainfrom
SaitejaKommi:fix/search-cache-invalidation
Open

fix(search): invalidate runtime caches when config changes#387
SaitejaKommi wants to merge 1 commit intoopenfoodfacts:mainfrom
SaitejaKommi:fix/search-cache-invalidation

Conversation

@SaitejaKommi
Copy link
Copy Markdown

Summary

This PR adds automatic invalidation for in-process search caches when the global configuration object changes.

It prevents stale query builders and result processors from being reused after configuration reloads, ensuring runtime behavior always matches the active configuration.


Related Issue

Fixes #386


What Changed

  • Added automatic cache invalidation when global config changes
  • Preserved cache reuse when configuration remains unchanged
  • Prevented stale query builders and result processors after reload
  • Added unit tests for cache reuse and invalidation behavior

Affected Files

  • search.py
  • test_search_runtime_cache.py

Testing

Full local gate executed successfully:

  • Backend unit tests ✅
  • Backend integration tests ✅
  • Frontend build and tests (dev) ✅
  • Frontend build and tests (prod) ✅

Notes

This is a runtime consistency improvement with no user-facing API changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (ready for dev)

Development

Successfully merging this pull request may close these issues.

Search runtime caches should invalidate when global config changes

1 participant