From c5bb032224c0a153719fa5f785738a786880b2e4 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 23 Feb 2024 11:36:20 -0700 Subject: [PATCH] Fix error logging (#8295) and some more clickhouse type mismatches, Co-Authored-By: Marshall Release Notes: - N/A Co-authored-by: Marshall --- crates/collab/.env.toml | 8 ++++---- crates/collab/src/api/events.rs | 8 ++++---- crates/collab/src/lib.rs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/collab/.env.toml b/crates/collab/.env.toml index 51d727624f..40c037e053 100644 --- a/crates/collab/.env.toml +++ b/crates/collab/.env.toml @@ -14,10 +14,10 @@ BLOB_STORE_URL = "http://127.0.0.1:9000" BLOB_STORE_REGION = "the-region" ZED_CLIENT_CHECKSUM_SEED = "development-checksum-seed" -CLICKHOUSE_URL = "http://localhost:8123" -CLICKHOUSE_USER = "" -CLICKHOUSE_PASSWORD = "" -CLICKHOUSE_DATABASE = "zed" +# CLICKHOUSE_URL = "" +# CLICKHOUSE_USER = "default" +# CLICKHOUSE_PASSWORD = "" +# CLICKHOUSE_DATABASE = "default" # RUST_LOG=info # LOG_JSON=true diff --git a/crates/collab/src/api/events.rs b/crates/collab/src/api/events.rs index 52f69f86d9..c687cad648 100644 --- a/crates/collab/src/api/events.rs +++ b/crates/collab/src/api/events.rs @@ -425,7 +425,7 @@ pub struct CallEventRow { release_channel: String, // ClientEventBase - installation_id: Option, + installation_id: String, session_id: Option, is_staff: Option, time: i64, @@ -453,7 +453,7 @@ impl CallEventRow { minor: semver.map(|s| s.minor as i32), patch: semver.map(|s| s.patch as i32), release_channel: body.release_channel.clone().unwrap_or_default(), - installation_id: body.installation_id.clone(), + installation_id: body.installation_id.clone().unwrap_or_default(), session_id: body.session_id.clone(), is_staff: body.is_staff, time: time.timestamp_millis(), @@ -480,7 +480,7 @@ pub struct AssistantEventRow { time: i64, // AssistantEventRow - conversation_id: Option, + conversation_id: String, kind: String, model: String, } @@ -506,7 +506,7 @@ impl AssistantEventRow { session_id: body.session_id.clone(), is_staff: body.is_staff, time: time.timestamp_millis(), - conversation_id: event.conversation_id, + conversation_id: event.conversation_id.unwrap_or_default(), kind: event.kind.to_string(), model: event.model, } diff --git a/crates/collab/src/lib.rs b/crates/collab/src/lib.rs index b3f31e86cc..355768a370 100644 --- a/crates/collab/src/lib.rs +++ b/crates/collab/src/lib.rs @@ -64,7 +64,7 @@ impl IntoResponse for Error { } Error::Database(error) => { log::error!( - "HTTP error {}: {}", + "HTTP error {}: {:?}", StatusCode::INTERNAL_SERVER_ERROR, &error ); @@ -72,7 +72,7 @@ impl IntoResponse for Error { } Error::Internal(error) => { log::error!( - "HTTP error {}: {}", + "HTTP error {}: {:?}", StatusCode::INTERNAL_SERVER_ERROR, &error );