Restore a full backup from Settings
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 30s

Settings → Data → Import gets "Restore a full backup" in place of the V1
import row. The zip from "Download backup" is uploaded and replaces the
database, every setting and the uploaded files on the running server:

- the staged database is upgraded to this schema (newer backups are refused),
  saved keys are re-encrypted for this server's key, interrupted jobs are
  marked, and the restoring session is carried over;
- a pre-restore snapshot is written, running generations stop, and the file
  is swapped under the open DB handle (DB.replaceWith); uploads and media are
  copied into place and background work restarts.

The /api/import/v1 endpoint stays for the V1 cutover (docs/MIGRATION.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-16 12:33:42 -07:00
parent e0bc7b580e
commit 7125dec3e0
13 changed files with 521 additions and 72 deletions

View file

@ -615,6 +615,14 @@ export function cancelGeneration(draftId: string): void {
running.delete(draftId);
}
/** Stops every running generation (before a full backup replaces the database). */
export function cancelAllGenerations(): number {
const n = running.size;
for (const c of running.values()) c.abort();
running.clear();
return n;
}
/** Listeners for a running job's progress labels (the assistant shows them on its tool step). */
const progressListeners = new Map<string, (label: string) => void>();

View file

@ -366,6 +366,11 @@ function forget(serverId: string): void {
sessions.delete(serverId);
}
/** Drops every open MCP session (after a restore the servers and their credentials may differ). */
export function forgetMcpSessions(): void {
sessions.clear();
}
export class McpError extends Error {
expired: boolean;
/** The server answered 401: the credentials are missing, wrong or expired. */