fix: close catalog review gaps
Publish documentation / publish (push) Successful in 38s

This commit is contained in:
Codex
2026-08-31 16:28:42 +02:00
parent 64fbe642ef
commit f586152636
7 changed files with 301 additions and 48 deletions
+5 -3
View File
@@ -159,7 +159,7 @@ export class CatalogService {
for (const id of Object.values(CATALOG_SECRET_IDS)) this.secretStore.forget(workspaceId, id);
}
async test(database: WorkspaceDatabase): Promise<DatabaseTestResult> {
async test(database: WorkspaceDatabase): Promise<WorkspaceDatabase | undefined> {
return await this.operations.run(database.id, async () => {
const testedAt = new Date().toISOString();
const controller = new AbortController();
@@ -168,6 +168,7 @@ export class CatalogService {
? database.binding.restAuth === "none" ? [] : [CATALOG_SECRET_IDS.apiKey]
: [];
const materialized = this.secretStore.materialize(database.workspaceId, required);
let result: DatabaseTestResult;
try {
if (database.binding.transport !== "rest_api") {
const client = await this.postgres.connect(database, controller.signal);
@@ -205,13 +206,13 @@ export class CatalogService {
},
});
}
return {
result = {
connectionStatus: "reachable",
testedVersion: database.version,
lastTestedAt: testedAt,
};
} catch {
return {
result = {
connectionStatus: "failed",
testedVersion: database.version,
lastTestedAt: testedAt,
@@ -223,6 +224,7 @@ export class CatalogService {
controller.abort();
materialized.release();
}
return await this.repository.recordTest(database.id, database.version, result);
});
}
}