Retention for finished messages and completed cards, plus overview pages #191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "retention-and-overview-pages"
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?
Waggle kept everything forever. This adds automatic cleanup, under one rule:
What is cleaned up, and what never is
Two per-user settings, each off / 30 / 90 / 180 / 365 days, defaulting to 90 for new accounts.
A completed card is also spared while it still has a live outgoing message attached, or while it still owes Mattermost an unsave (
cleanup_statuspending/running/failed). That last guard matters: deleting such a card would leave the message flagged "saved" in Mattermost with nothing left in Waggle to un-flag it.What disappears is Waggle's own copy. The Mattermost messages stay where they are. Only a message that was never sent is genuinely lost, and the settings copy says so.
Accounts predating the migration start switched off. Otherwise the first nightly sweep would have deleted years of archive before anyone had seen the setting. Those users get a one-time banner offering to switch it on at 90 days.
Three pages for what is kept
Reachable from the menu, rendered with the app's own card components rather than a bespoke list:
/concept-berichten) - a draft lived in no list at all before this, because both scheduled-post endpoints filter drafts out. A half-written reply was unreachable without opening the exact card it hung on./uitgaande-post) - everything outgoing in three sections, failures first. Outgoing messages previously lived as sections inside the card lists, and sent messages were visible nowhere./notities) - the cards that are never cleaned up.Two defects that were not in the issue
Both found during review, both closed, each pinned by a test that fails against the bug:
referencedset fromselect(OutgoingPost.files)with no state filter, so a dead row kept its attachment alive. Nothing cleaned up on cancel or on a failed send; only the manual "Gelezen, verberg" button did.Attachment bytes are released only after the deleting transaction commits, and only through
_delete_orphan_refs, because a ref can legitimately be held by a live draft - editing a scheduled post cancels the row and re-hangs its files on the new draft.Also here
The terms are re-readable on
/voorwaarden, with the date they were accepted, from a single shared component so the retention sentence cannot drift between the two places./welkomdrops its connect-Mattermost step: a server is linked from Instellingen, and a new user without one gets a banner pointing there.Accepted trade-offs
docs/deployment.mdrather than left implicit.Issue #146
Closed with a different solution than it asked for. The issue wanted a maximum age on draft attachments; drafts are kept instead, and answered with a findable list.
docs/deployment.mdis updated accordingly.Tested
Backend 1610 tests at 100% branch coverage, on SQLite and Postgres. Frontend 570 unit tests, 63 e2e. The migration's data step - the line that decides whether a deploy destroys data - has its own tests, because
alembic/versions/sits outside the coverage gate.Separately filed: #205, our universal CSS reset strips the padding from NLDD components that style their host, and MinBZK/storybook#160 as the upstream hardening suggestion.
GET /api/cards returns active cards plus only the 50 most recent completed ones, while the overview pages link to a card of any age via /?kaart=<id>. A noted, long-completed card therefore changed the URL and rendered nothing. Add GET /api/cards/{card_id} (user-scoped, 404 for someone else's card) and let useSelectedCard fall back to it when the loaded list misses. PUT /api/settings now marks hint.retention.v1 seen whenever a retention field is supplied. Setting both categories to "Niet opruimen" leaves both columns null, which is the intro banner's own trigger, so the banner came back to offer switching on what the user had just switched off.7892758a642aaad960a82aaad960a8f950032cfb1839e06718b84b34b176a97ee477fcb326d83f75b326d83f759b940834209b9408342020e73883b120e73883b154bfffd2ca54bfffd2cac4f334409b