fix(connection): per-id saves stop cross-client connection clobber
This commit is contained in:
9 files changed
+188
-35
No files matched your search
@@ -570,7 +570,12 @@ export async function closeDatabaseConnection(connectionId: string, database: st
|
||||
return post("/api/connection/close-database", { connectionId, database });
|
||||
}
|
||||
|
||||
export async function saveConnections(configs: ConnectionConfig[]): Promise<void> {
|
||||
export async function saveConnections(configs: ConnectionConfig[], removedIds: string[] = []): Promise<void> {
|
||||
// Saving upserts; ids this client deleted are sent explicitly so that a
|
||||
// stale local list can never drop connections another client created.
|
||||
if (removedIds.length) {
|
||||
return post("/api/connection/save", { configs, removedIds });
|
||||
}
|
||||
return post("/api/connection/save", { configs });
|
||||
}
|
||||
|
||||
|
||||
@@ -2511,8 +2511,8 @@ export async function exportDocsHtml(filePath: string, snapshot: SchemaSnapshot,
|
||||
return invoke("docs_export_html", { filePath, snapshot, annotations, lang });
|
||||
}
|
||||
|
||||
export async function saveConnections(configs: ConnectionConfig[]): Promise<void> {
|
||||
return invoke("save_connections", { configs });
|
||||
export async function saveConnections(configs: ConnectionConfig[], removedIds: string[] = []): Promise<void> {
|
||||
return invoke("save_connections", { configs, removedIds });
|
||||
}
|
||||
|
||||
export async function loadConnections(): Promise<ConnectionConfig[]> {
|
||||
|
||||
Reference in new issue
Block a user