fix: refresh optional CLI Apps catalogs

maintainer edit: CLI Apps settings now treats optional catalog caches as refresh candidates without blocking the initial payload, and pending polling stops when refresh is throttled instead of running indefinitely.
This commit is contained in:
chengyongru
2026-06-22 17:14:13 +08:00
committed by Xubin Ren
parent 2216405821
commit dd2cb4ca91
5 changed files with 95 additions and 13 deletions
+15
View File
@@ -286,6 +286,21 @@ def test_payload_cache_only_does_not_fetch_catalog(tmp_path: Path, monkeypatch:
assert manager.catalog_cache_fresh() is True
def test_catalog_cache_fresh_can_include_optional_sources(tmp_path: Path) -> None:
manager = _manager(tmp_path)
_write_cache(
manager._cache_path("harness"),
{"meta": {"updated": "2026-04-16"}, "clis": []},
)
_write_cache(
manager._cache_path("public"),
{"meta": {"updated": "2026-04-18"}, "clis": []},
)
assert manager.catalog_cache_fresh() is True
assert manager.catalog_cache_fresh(include_optional=True) is False
def test_payload_cache_only_without_cache_returns_empty(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
manager = _manager(tmp_path)