From 5094e1d50fe70063fd97da908e1e5a76ba5daeaa Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Apr 2026 19:02:02 +0000 Subject: [PATCH 1/2] fix(cache): improve unrecognized database version error message Explain that the cache may have been created by a newer version of Vite Task and suggest running ` cache clean`. https://claude.ai/code/session_01R6o7gtdDeEVkd6TXNgNi5q --- crates/vite_task/src/session/cache/mod.rs | 8 ++++++-- crates/vite_task/src/session/mod.rs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/vite_task/src/session/cache/mod.rs b/crates/vite_task/src/session/cache/mod.rs index 885dc97d6..690d50d43 100644 --- a/crates/vite_task/src/session/cache/mod.rs +++ b/crates/vite_task/src/session/cache/mod.rs @@ -176,7 +176,7 @@ pub fn split_path(path: &str) -> (Option<&str>, &str) { impl ExecutionCache { #[tracing::instrument(level = "debug", skip_all)] - pub fn load_from_path(path: &AbsolutePath) -> anyhow::Result { + pub fn load_from_path(path: &AbsolutePath, program_name: &str) -> anyhow::Result { tracing::info!("Creating task cache directory at {:?}", path); std::fs::create_dir_all(path)?; @@ -211,7 +211,11 @@ impl ExecutionCache { } 11 => break, // current version 12.. => { - return Err(anyhow::anyhow!("Unrecognized database version: {user_version}")); + return Err(anyhow::anyhow!( + "Unrecognized database version: {user_version}. \ + The cache may have been created by a newer version of Vite Task. \ + Run `{program_name} cache clean` to remove it." + )); } } } diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index a6968c90e..6ed000f77 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -554,7 +554,8 @@ impl<'a> Session<'a> { /// /// Returns an error if the cache database cannot be loaded or created. pub fn cache(&self) -> anyhow::Result<&ExecutionCache> { - self.cache.get_or_try_init(|| ExecutionCache::load_from_path(&self.cache_path)) + self.cache + .get_or_try_init(|| ExecutionCache::load_from_path(&self.cache_path, &self.program_name)) } pub fn workspace_path(&self) -> Arc { From caa768c84124b9d68f1d1429303a820882653fea Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Apr 2026 19:06:15 +0000 Subject: [PATCH 2/2] style: cargo fmt https://claude.ai/code/session_01R6o7gtdDeEVkd6TXNgNi5q --- crates/vite_task/src/session/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index 6ed000f77..eb9ca6411 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -554,8 +554,9 @@ impl<'a> Session<'a> { /// /// Returns an error if the cache database cannot be loaded or created. pub fn cache(&self) -> anyhow::Result<&ExecutionCache> { - self.cache - .get_or_try_init(|| ExecutionCache::load_from_path(&self.cache_path, &self.program_name)) + self.cache.get_or_try_init(|| { + ExecutionCache::load_from_path(&self.cache_path, &self.program_name) + }) } pub fn workspace_path(&self) -> Arc {