From ee7a4be95c829d3f6b2ade23b0fd3987cffc3569 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 7 Dec 2022 18:22:36 +0100 Subject: [PATCH] Fix the instance-uid in the data.ms We were writing the instance-uid as bytes instead of string in the data.ms and thus we were unable to parse it later. Also it was less practical for our user to retrieve it and send it to us. --- meilisearch-http/src/analytics/segment_analytics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilisearch-http/src/analytics/segment_analytics.rs b/meilisearch-http/src/analytics/segment_analytics.rs index afec4c5cb..8697a3e82 100644 --- a/meilisearch-http/src/analytics/segment_analytics.rs +++ b/meilisearch-http/src/analytics/segment_analytics.rs @@ -39,7 +39,7 @@ const ANALYTICS_HEADER: &str = "X-Meilisearch-Client"; /// Write the instance-uid in the `data.ms` and in `~/.config/MeiliSearch/path-to-db-instance-uid`. Ignore the errors. fn write_user_id(db_path: &Path, user_id: &InstanceUid) { - let _ = fs::write(db_path.join("instance-uid"), user_id.as_bytes()); + let _ = fs::write(db_path.join("instance-uid"), user_id.to_string()); if let Some((meilisearch_config_path, user_id_path)) = MEILISEARCH_CONFIG_PATH.as_ref().zip(config_user_id_path(db_path)) {