mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 23:12:04 +00:00
fix(admin): say what actually ages a stored account copy out
The backups page stated "Retention: 90 days", from a constant whose comment said it matched a backup-prune job. There is no such job: nothing deletes a stored copy by age. The weekly copy is replaced in place, one per account; the copy taken before "Delete all data" is deleted by the account-deletion purge when the grace window ends; an uploaded copy stays until its account is erased. The list now carries preWipeCopyDays (the grace window, 0 when no such copy is taken) instead of retentionDays, and the page says exactly the three facts above, in every language. Also drops a re-export of the JSON import row limit nothing imports.
This commit is contained in:
1 parent
459b5baa9d
commit
694befd635
17 files changed
+62
-37
No files matched your search
@@ -153,6 +153,16 @@ describe("GET /api/admin/backups — off-host freshness", () => {
|
||||
expect(byName.get("account-five")?.lastAttemptAt).toBeNull();
|
||||
});
|
||||
|
||||
it("states what ages a stored copy out, and invents no retention", async () => {
|
||||
configuredMock.mockReturnValue(false);
|
||||
findManyMock.mockResolvedValue([]);
|
||||
vi.stubEnv("ACCOUNT_DELETION_GRACE_DAYS", "21");
|
||||
const body = await read();
|
||||
vi.unstubAllEnvs();
|
||||
expect(body.preWipeCopyDays).toBe(21);
|
||||
expect(body).not.toHaveProperty("retentionDays");
|
||||
});
|
||||
|
||||
it("says so when neither the environment nor the ledger knows of any upload", async () => {
|
||||
configuredMock.mockReturnValue(false);
|
||||
findManyMock.mockResolvedValue([
|
||||
|
||||
@@ -38,6 +38,7 @@ import {
|
||||
import { OFFHOST_BACKUP_QUEUE } from "@/lib/jobs/offhost-backup-queue";
|
||||
import { offhostPurgeDue } from "@/lib/jobs/offhost-purge-queue";
|
||||
import { ACTIVE_ACCOUNT } from "@/lib/account-deletion/active-account";
|
||||
import { accountDeletionGraceDays } from "@/lib/account-deletion/grace";
|
||||
import {
|
||||
classifyOffhostBackup,
|
||||
OFFHOST_BACKUP_PERIOD_HOURS,
|
||||
@@ -213,9 +214,11 @@ export const GET = apiHandler(async () => {
|
||||
|
||||
const payload: BackupsList = {
|
||||
rows: list,
|
||||
// Matches the retention window the backup-prune job enforces so the
|
||||
// backups page states the same number the worker acts on.
|
||||
retentionDays: 90,
|
||||
// What ages these copies out, and nothing more: no job prunes stored
|
||||
// copies by age. The weekly copy is replaced in place, a pre-wipe copy
|
||||
// is deleted by the account-deletion purge when its window ends, and an
|
||||
// uploaded copy stays until its account is erased.
|
||||
preWipeCopyDays: accountDeletionGraceDays(),
|
||||
schedule: summariseBackupSchedule({
|
||||
scheduledCreatedAt: rows
|
||||
.filter((row) => row.type === SCHEDULED_BACKUP_TYPE)
|
||||
|
||||
Reference in new issue
Block a user