A site archived on the farm outside the console is never purged, and one archived twice can be purged at once #246
Closed
opened 2026-10-22 06:46:29 +00:00 by cgalo5758
·
1 comment
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Public launch
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#246
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
The sync copies a farm-side status onto the site row (
UpsertSiteFromFarm) without touchingarchived_at; only the console's own status write (SetSiteStatusByDomain) sets or clears it. The retention purge takes archived rows whosearchived_atis 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
archivedstampsarchived_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.
Fixed in
d87cb15a.The database now sets
archived_atitself. A trigger onfedwiki.sitesruns on every insert and update: a site whose new status is notarchivedgets no archive time, a site that entersarchived(or is inserted archived) gets the time of that write, and a site that stays archived keeps its time. A time the query supplies is ignored, so the sync, the console's own status writes and any writer added later all follow the same rule, and no query sets the column any more.Both cases in this issue now behave as described under "What should happen":
What this does not cover: if the farm restores and re-archives a site between two sync runs, the console never sees the restore, so the site keeps its first archive time.
Existing rows are not rewritten by the migration; each is corrected on its next write, which with the sync enabled is the next sync run. A deployment that wants to check its archived sites should count them and fix any suspect time before upgrading; after the upgrade, a hand correction has to move the row out of
archivedand back in one transaction, since the trigger ignores a time written directly.