Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

feat(connection): preserve failed one-time connections

zipgb488942d82c5
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue
index a0eda63d6f..37489c2514 100644
--- a/apps/desktop/src/components/connection/ConnectionDialog.vue
+++ b/apps/desktop/src/components/connection/ConnectionDialog.vue
@@ -5190,7 +5190,8 @@ async function save() {
.catch((e: any) => {
const message = String(e?.message || e);
if (message.includes(CONNECTION_ATTEMPT_CANCELLED_MESSAGE)) return;
- if (config.one_time) void store.removeConnection(config.id);
+ // Keep failed one-time connections available for retry and error inspection.
+ // They are still removed by connectionStore.disconnect after a successful session.
emit("connectFailed", appendConnectionErrorHints(config, mongodbAuthFailureHint(message), t));
});
return;
diff --git a/apps/desktop/src/lib/__tests__/connection/connectionDialog.deepLinkServices.spec.ts b/apps/desktop/src/lib/__tests__/connection/connectionDialog.deepLinkServices.spec.ts
index dc67c37806..6646a3b188 100644
--- a/apps/desktop/src/lib/__tests__/connection/connectionDialog.deepLinkServices.spec.ts
+++ b/apps/desktop/src/lib/__tests__/connection/connectionDialog.deepLinkServices.spec.ts
@@ -31,4 +31,13 @@ describe("ConnectionDialog service deep-link hydration", () => {
expect(applyBody).toContain("parseConnectionDeepLink(input) ?? parseServiceConnectionUrl(input)");
expect(applyBody.indexOf("applyConnectionDraftToForm")).toBeLessThan(applyBody.indexOf("parseConnectionUrl(input"));
});
+
+ it("keeps failed one-time connections available for error inspection and retry", () => {
+ const saveStart = source.indexOf("async function save()");
+ const saveEnd = source.indexOf('const dialogTitle = ref("")', saveStart);
+ const saveBody = source.slice(saveStart, saveEnd);
+
+ expect(saveBody).not.toContain("store.removeConnection(config.id)");
+ expect(saveBody).toContain('emit("connectFailed"');
+ });
});