From 968344460f9f662c68da6596b20fc0f4e4a91297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Thu, 4 Jan 2024 19:21:18 +0300 Subject: [PATCH 1/2] fix: re-download the repodata cache if it is corrupted --- crates/rattler_repodata_gateway/src/fetch/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rattler_repodata_gateway/src/fetch/mod.rs b/crates/rattler_repodata_gateway/src/fetch/mod.rs index d2cfb6f21..7951f898d 100644 --- a/crates/rattler_repodata_gateway/src/fetch/mod.rs +++ b/crates/rattler_repodata_gateway/src/fetch/mod.rs @@ -962,7 +962,7 @@ fn validate_cached_state( tracing::warn!( "BLAKE2 hash of repodata.json does not match cache state. Ignoring cached files..." ); - return ValidatedCacheState::Mismatched(cache_state); + return ValidatedCacheState::InvalidOrMissing; } } } From 23879bcee592657b5f08726ab05293039b9323d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Thu, 4 Jan 2024 19:26:06 +0300 Subject: [PATCH 2/2] chore: implement Debug for ValidatedCacheState --- crates/rattler_repodata_gateway/src/fetch/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/rattler_repodata_gateway/src/fetch/mod.rs b/crates/rattler_repodata_gateway/src/fetch/mod.rs index 7951f898d..634ef8eba 100644 --- a/crates/rattler_repodata_gateway/src/fetch/mod.rs +++ b/crates/rattler_repodata_gateway/src/fetch/mod.rs @@ -859,6 +859,7 @@ fn normalize_subdir_url(url: Url) -> Url { } /// A value returned from [`validate_cached_state`] which indicates the state of a repodata.json cache. +#[derive(Debug)] enum ValidatedCacheState { /// There is no cache, the cache could not be parsed, or the cache does not reference the same /// request. We can completely ignore any cached data.