A site archived on the farm outside the console is never purged, and one archived twice can be purged at once #246

Open
opened 2026-10-22 06:46:29 +00:00 by cgalo5758 · 0 comments
Owner

What happens

The sync copies a farm-side status onto the site row (UpsertSiteFromFarm) without touching archived_at; only the console's own status write (SetSiteStatusByDomain) sets or clears it. The retention purge takes archived rows whose archived_at is set and older than 30 days. So a site archived on the farm outside the console keeps its content and its name forever, while the member's Archived section says archived sites are removed automatically after 30 days.

In reverse, a site archived in the console and restored on the farm keeps its first archived_at. If the farm archives it again later, the purge at the end of that same sync run can delete it permanently at once.

What should happen

Any write that moves a row into archived stamps archived_at, and any write that moves it out clears it, so the 30 days start when the console first sees the archive.

Where

internal/integrations/fedwiki/store/queries/sites.sql (UpsertSiteFromFarm, ListArchivedSitesArchivedBefore), internal/integrations/fedwiki/workflows/sync.go, internal/integrations/fedwiki/workflows/reconcile.go (PurgeExpiredArchivedActivity)

Steps

Enable the sync, archive a site through the farm manager API, wait one tick, and read the row's archived_at.

Why it matters

Members are told archived sites go after 30 days, and the reverse case erases a site with no window at all.

### What happens The sync copies a farm-side status onto the site row (`UpsertSiteFromFarm`) without touching `archived_at`; only the console's own status write (`SetSiteStatusByDomain`) sets or clears it. The retention purge takes archived rows whose `archived_at` is set and older than 30 days. So a site archived on the farm outside the console keeps its content and its name forever, while the member's Archived section says archived sites are removed automatically after 30 days. In reverse, a site archived in the console and restored on the farm keeps its first `archived_at`. If the farm archives it again later, the purge at the end of that same sync run can delete it permanently at once. ### What should happen Any write that moves a row into `archived` stamps `archived_at`, and any write that moves it out clears it, so the 30 days start when the console first sees the archive. ### Where `internal/integrations/fedwiki/store/queries/sites.sql` (`UpsertSiteFromFarm`, `ListArchivedSitesArchivedBefore`), `internal/integrations/fedwiki/workflows/sync.go`, `internal/integrations/fedwiki/workflows/reconcile.go` (`PurgeExpiredArchivedActivity`) ### Steps Enable the sync, archive a site through the farm manager API, wait one tick, and read the row's `archived_at`. ### Why it matters Members are told archived sites go after 30 days, and the reverse case erases a site with no window at all.
cgalo5758 added this to the Public launch milestone 2026-10-22 06:46:29 +00:00
cgalo5758 added the
kind
bug
area/fedwiki
labels 2026-10-22 06:46:29 +00:00
Sign in to join this conversation.
No labels area/fedwiki
kind
bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#246