fix(storage): a pass on a database this installation does not recognise only reports

While a restore's reset is still pending, or the database names another
installation, the nightly pass judges and reports but deletes nothing,
whatever the restored switch says.
This commit is contained in:
Maurice
2026-11-01 18:32:33 +01:00
parent e6d52cb061
commit 13332cf06b
2 changed files with 21 additions and 2 deletions
@@ -258,7 +258,12 @@ export class StorageReclaimService implements OnModuleInit {
private async pass(reportOnly: boolean, now: Date): Promise<StorageReclaimReport> {
const wallStart = Date.now();
const installId = this.install.installId();
const deleting = !reportOnly && installId !== null && (await readReclaimDeleteEnabled(this.appSettings, installId));
// A database this installation does not recognise (a restore whose reset did not run yet) only reports.
const deleting =
!reportOnly &&
installId !== null &&
(await this.install.databaseIsThis(installId)) &&
(await readReclaimDeleteEnabled(this.appSettings, installId));
const ctx: PassContext = {
now: now.getTime(),
installId,