From 4024dc6a679bc04a8957f3c433c3a439b12ee7ef Mon Sep 17 00:00:00 2001 From: hhzorg Date: Mon, 6 Jul 2026 22:04:19 +0800 Subject: [PATCH] fix(milvus): send empty JSON body to databases/list endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #2698. The databases/list call posted with no request body, which the Milvus demo cluster used during testing accepts. Production Milvus is stricter: a bodyless POST returns HTTP 200 with `{"code":1801,...}` and omits the `data` field. Since the success check only inspects the HTTP status, list_milvus_databases() parsed zero names and silently fell back to `["default"]`, hiding every non-default database in the sidebar. Send an empty JSON object `{}` as the body, matching every other Milvus v2 endpoint. With the body, the endpoint returns code 0 and the full database list on both demo and production clusters. Ref #2693 Co-authored-by: 朱豪豪 --- crates/dbx-core/src/db/vector_driver.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/dbx-core/src/db/vector_driver.rs b/crates/dbx-core/src/db/vector_driver.rs index 3d413e0473..59aad278b7 100644 --- a/crates/dbx-core/src/db/vector_driver.rs +++ b/crates/dbx-core/src/db/vector_driver.rs @@ -183,7 +183,11 @@ pub async fn list_databases(client: &VectorClient) -> Result, String async fn list_milvus_databases(client: &VectorClient) -> Result, String> { // Older Milvus versions (pre-2.2) do not expose the databases endpoint; fall back to "default" // so the connection stays browsable instead of failing the whole tree load. - let body = match send_json(client.post("/v2/vectordb/databases/list"), "Milvus").await { + // + // The endpoint rejects a bodyless POST with `{"code":1801,...}` (HTTP 200, no `data` field), + // so send an empty JSON object like every other Milvus v2 endpoint. + let body = match send_json(client.post("/v2/vectordb/databases/list").json(&serde_json::json!({})), "Milvus").await + { Ok(body) => body, Err(_) => return Ok(vec!["default".to_string()]), };