From b6818b4f52c202e82f9a7bd06b15fe403d47764f Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Sep 2026 09:36:55 -0700 Subject: [PATCH] fix(import): trim the already-imported warning Co-Authored-By: Claude Opus 5 --- crates/yaak-grpc/bindings/gen_grpc.ts | 5 +++++ crates/yaak/src/import.rs | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 crates/yaak-grpc/bindings/gen_grpc.ts diff --git a/crates/yaak-grpc/bindings/gen_grpc.ts b/crates/yaak-grpc/bindings/gen_grpc.ts new file mode 100644 index 00000000..7f050ab1 --- /dev/null +++ b/crates/yaak-grpc/bindings/gen_grpc.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type MethodDefinition = { name: string, schema: string, clientStreaming: boolean, serverStreaming: boolean, }; + +export type ServiceDefinition = { name: string, methods: Array, }; diff --git a/crates/yaak/src/import.rs b/crates/yaak/src/import.rs index b49278d7..49703ed2 100644 --- a/crates/yaak/src/import.rs +++ b/crates/yaak/src/import.rs @@ -331,8 +331,8 @@ fn warn_if_imported_elsewhere(db: &ClientDb, plan: &mut ImportPlan) -> Result<() } let names = names.iter().map(String::as_str).collect::>(); plan.warnings.push(ImportPlanWarning::warning( - format!("This document is already imported into {}", display_list(&names)), - "Importing it here makes a second copy instead of updating that one", + format!("Already imported into {}", display_list(&names)), + "Importing here makes a second copy", )); Ok(()) } @@ -1758,17 +1758,14 @@ mod tests { let warning = elsewhere .warnings .iter() - .find(|w| w.title == "This document is already imported into Imported") + .find(|w| w.title == "Already imported into Imported") .expect("copying a document that already landed somewhere is called out"); - assert_eq!( - warning.detail, - "Importing it here makes a second copy instead of updating that one" - ); + assert_eq!(warning.detail, "Importing here makes a second copy"); // Merging back into the workspace it created is the whole point, so it says nothing. let merging = replan(&query_manager, &workspace_id, imported_resources()); assert!( - merging.warnings.iter().all(|w| !w.title.starts_with("This document is already")), + merging.warnings.iter().all(|w| !w.title.starts_with("Already imported")), "{:?}", merging.warnings );