fix(backup): make the console restore leave instance settings alone

A disaster-recovery snapshot carries the singleton `app_settings` row —
registration, the MFA requirement, the default locale and timezone, module
availability, the notification and AI configuration, the document size cap and
quota — and the restore wrote it back as a side effect of restoring one
account. An operator putting a single record back on Wednesday reconfigured the
whole host from Monday's file, silently, with nothing on screen saying so.

Rebuilding a host from a snapshot is a real case, so the write stays: it is now
`restoreInstanceSettings: true` on the request and a checkbox beside the typed
gate, off unless the operator ticks it. Restoring an account and reconfiguring
the installation are two decisions, so they are two answers.

The 422 confirmation sentence and the dialog copy drop the instance-wide claim;
the opt-in carries it instead, in all seven catalogues. Integration coverage
runs both arms: without the flag the settings row keeps its own values, with it
the file's values land.
This commit is contained in:
Marc-André Bombeck committed 2026-09-10 05:16:59 +02:00
1 parent 5cb5c7df44
commit 6b366b4f27
12 files changed
+189 -22

No files matched your search

@@ -140,12 +140,21 @@ describe("BackupsSection — empty state", () => {
expect(className).not.toMatch(/\b(?:opacity-\d+|text-\S+\/\d+)\b/);
});
it("warns in both catalogs that restore overwrites instance-wide settings", () => {
expect(de.admin.section.backups.restoreDescription).toMatch(
it("names the instance-wide effect on the opt-in that carries it, in both catalogs", () => {
// The restore rewrites the host's own settings only when the operator
// ticks the box, so the warning belongs to the box rather than to the
// sentence above it — and the box has to say what it turns on.
expect(de.admin.section.backups.restoreInstanceSettingsLabel).toMatch(
/instanzweite Einstellungen/i,
);
expect(en.admin.section.backups.restoreDescription).toMatch(
/instance-wide settings/i,
expect(de.admin.section.backups.restoreInstanceSettingsHint).toMatch(
/Installation/,
);
expect(en.admin.section.backups.restoreInstanceSettingsLabel).toMatch(
/instance settings/i,
);
expect(en.admin.section.backups.restoreInstanceSettingsHint).toMatch(
/installation/i,
);
});
});