Offer a full pond archive before deletion and before purge #305
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#305
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deleting a pond should offer a last full archive to download.
What already exists — and where the real gap is
A safety prompt is already in place:
DeletePondSection(
apps/web/src/ponds/DeletePondSection.tsx) requires typing the pondname exactly and keeps the button disabled until it matches, the same
backstop as the backup restore. That stays as it is — it is stricter than
a confirm dialog and needs no focus management.
Deletion is a soft delete into the site-level trash
(
PondsService.softDelete,apps/api/src/ponds/ponds.service.ts:180),and a site admin can restore. But
purgeDuePonds()(
apps/api/src/trash/trash.module.ts:46) removes trashed ponds for goodafter
trash.retentionDays(default 30), and a site admin can purgemanually (#193). The purge test states the standard: after it, nothing
referencing the pond survives — neither rows nor files on disk.
The gap is therefore not the missing prompt. It is that the person who
deletes the pond loses access the moment they do: the pond disappears
from their view, only a site admin can bring it back, and the existing
pond export is no longer reachable for them. The archive has to be
offered inside the deletion flow, not afterwards.
Scope of the archive: full, not just pages
The existing
exportPond(apps/api/src/import-export/export.service.ts:78)ships Markdown plus the images referenced by pages. As a last resort
that is not enough — an attachment nobody embedded would vanish
unnoticed. The archive for this flow contains:
machine-readable sidecar.
Build on the archive-level
manifest.jsonthat already exists (#210,export.service.ts:206) — extend it rather than adding a seconddescriptor. Give it an explicit format version so a later reader can tell
what it is looking at.
Re-import is out of scope for this issue. The archive is a
preservation format: complete, documented and versioned, so an importer
can be written later without guesswork. Building that importer is a
separate piece of work. Say so in the UI text too — the user must not
believe they are holding a one-click restore.
Where the offer appears
the pond is trashed.
irreversible step.
The automatic purge after the retention period gets no server-side
archive. That was considered and rejected: it would consume storage on
the instance indefinitely and raises the unanswerable question of who
deletes those archives.
Not downloading is allowed. When the archive has not been fetched, the
confirmation area states plainly that after the retention period nothing
of the pond remains. No forced download — a pond full of test pages
should not require one, and the server cannot tell whether a file
actually arrived anyway.
Completeness depends on who is asking
appendPondMarkdownfilters by the requester's read permissions(
export.service.ts:113), so a pond admin who cannot read every pagegets an incomplete archive. This must be visible, not implied:
the UI with the number of omitted pages.
construction.
An archive silently missing content is worse than no archive, because it
ends the search.
VS-NfD obligations
The archive is a bulk egress channel and the read trail already treats
the pond ZIP as one:
appendPondMarkdownrecords anexportevent perclassified page before any classified bytes enter the stream, so a
failed write aborts the download with the evidence intact (ADR 0023).
The full archive must keep this property — including for the newly added
attachments, whose pages carry the classification.
Classification markings and the
VS-NfD_filename prefix stay as theyare; the extended manifest keeps carrying the per-file level and the
archive's highest level.
Check whether "pond archive downloaded" warrants its own audit action. If
so, it needs an entry in
apps/api/src/audit/audit-actions.tsand indocs/architecture/audit-events.mdwith a catalogue minor bump — thegate
audit-catalogue.test.tsfails otherwise.Accessibility
keyboard, with a localised name that says what it produces.
announced, not only shown by a spinner.
by assistive technology — not conveyed by colour or an icon alone.
button's disabled state.
apps/web/e2e/a11y.spec.tsper the standing rule.Acceptance criteria
before the pond is trashed.
and a versioned manifest with settings, labels, comments and
hierarchy.
verified by hand, not only asserted in a test.
omitted before downloading.
exportevents before anyclassified bytes are streamed, attachments included.
docs/, with its version.pnpm lint,pnpm typecheck,pnpm i18n:check, api suite and thea11y spec pass.