From 7ebed7a843bce5e3cf447ef703e2733a63e9a04b Mon Sep 17 00:00:00 2001 From: Brother Darryl <146fb160a3266e6165bfa385f6048c975eda9e21cf65da097a0b5ea7952532a5@buzz.block.builderlab.xyz> Date: Tue, 11 Aug 2026 13:25:48 -0400 Subject: [PATCH] fix(desktop): normalize local SQLite URLs Signed-off-by: Brother Darryl <146fb160a3266e6165bfa385f6048c975eda9e21cf65da097a0b5ea7952532a5@buzz.block.builderlab.xyz> --- desktop/src-tauri/src/local_relay.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/desktop/src-tauri/src/local_relay.rs b/desktop/src-tauri/src/local_relay.rs index 7fd6497ac..26e18e9e7 100644 --- a/desktop/src-tauri/src/local_relay.rs +++ b/desktop/src-tauri/src/local_relay.rs @@ -219,9 +219,8 @@ fn local_data_dir(app: &AppHandle, owner_pubkey: &str) -> Result String { - // sqlx accepts an absolute sqlite URL with three slashes. Path display is - // intentional: app-data paths come from the OS, not user relay input. - format!("sqlite://{}", path.display()) + // SQLite URLs use forward slashes so this contract is canonical across platforms. + format!("sqlite://{}", path.display().to_string().replace('\\', "/")) } /// Load the relay's service identity from its identity-scoped nest, or create @@ -416,6 +415,14 @@ mod tests { ); } + #[test] + fn sqlite_url_normalizes_windows_separators() { + assert_eq!( + sqlite_url(Path::new(r"C:\tmp\buzz.sqlite3")), + "sqlite://C:/tmp/buzz.sqlite3" + ); + } + #[test] fn local_relay_sentinel_is_the_only_managed_workspace_address() { assert_eq!(local_relay_url(4317), "ws://127.0.0.1:4317"); @@ -491,7 +498,12 @@ mod tests { ); assert_eq!( env.get("BUZZ_LOCAL_MEDIA_DIR"), - Some(&"/tmp/buzz/local-relay/media".to_string()) + Some( + &PathBuf::from("/tmp/buzz/local-relay") + .join("media") + .display() + .to_string() + ) ); assert_eq!( env.get("BUZZ_REQUIRE_RELAY_MEMBERSHIP"),