mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-21 08:13:34 +00:00
feat(connection): preserve failed one-time connections
This commit is contained in:
@@ -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;
|
||||
|
||||
+9
@@ -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"');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user