pub fn resolve_ui_bundle(
reddb_cache_root: &Path,
fetcher: &dyn UiBundleFetcher,
) -> Result<PathBuf, Error>Expand description
Ensure the pinned red-ui bundle is cached and return its directory.
§Behaviour
- Cache hit: if
<reddb_cache_root>/ui/<version>/manifest.jsonexists and records the pinned version and SHA-256, return the directory immediately — no network call. - Cache miss: download the release asset via
fetcher, verify SHA-256 (reject on mismatch), extract the tgz into a staging directory, write the manifest, and atomically promote to the live version directory. - Offline first-run: if
fetcherreturns an error and no cached bundle exists, propagate a cleario::Errorwith an actionable message.
reddb_cache_root is the ~/.cache/reddb base (use
reddb_user_cache_root to derive it). In tests, pass a TempDir
path to keep caches isolated.