ulysses/src/search
mist 5ebe9ee67a
Fix invalidate_search_cache using a key that never matches stored entries (#852)
invalidate_search_cache(query) built its cache key as
generate_cache_key(f"{query}|10|None"), but the write path
(searxng_search_results) replaces the caller's default count of 10 with the
admin-configured _get_result_count() (default 5) before building the key.

So a default search for "X" is cached under "X|5|None", while invalidation
looked for "X|10|None" — they never match, and invalidate_search_cache
silently failed to remove anything in the default configuration, violating
its docstring ("invalidate ... just the given query").

Derive the count from _get_result_count() so invalidation matches the
default-search entry the write path actually stores. The same bug (and fix)
applies to both the src/search and services/search copies.

Note: time-filtered variants (e.g. "X|5|day") still aren't reachable from a
query-only signature, since cache keys are opaque SHA-256 hashes with no
stored query; clearing those would need a broader cache-index redesign and is
out of scope here.

Adds tests/test_search_cache_invalidation.py covering the default-count case.
2026-06-02 10:53:33 +09:00
..
__init__.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
analytics.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
cache.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
content.py Add SSRF-guarded web fetch agent tool 2026-06-01 16:57:28 +09:00
core.py Fix invalidate_search_cache using a key that never matches stored entries (#852) 2026-06-02 10:53:33 +09:00
providers.py fix: resolve DuckDuckGo redirect URLs in HTML fallback search 2026-06-01 19:42:01 -03:00
query.py Fix year extraction in research queries 2026-06-01 23:09:41 +09:00
ranking.py Odysseus v1.0 2026-05-31 23:58:26 +09:00