FedWiki sites stay active after a plan ends when no remaining rule covers sites #330
Open
opened 2026-11-14 21:23:05 +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
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#330
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
An organization holds a plan whose entitlement set (the list of rules a product delivers) carries a limit on FedWiki sites. The plan ends: the subscription is cancelled, a grant expires or is revoked, or the subscription is suspended for non-payment. If nothing the organization still holds carries a rule for
fedwiki_sites, the limit becomes 0 and the create form refuses a new site, but every existing site stays active and writable for as long as the organization likes.The maintenance sweep that makes surplus sites read-only does nothing for that organization. It acts only when a rule that still funds the limit carries the reduction policy "Force reduce" (the rule's setting for what happens to sites above a lowered limit), and here no rule is left to carry it.
The same happens when an operator removes the
fedwiki_sitesrule from an entitlement set. Every organization that held the limit only through that rule drops to 0 and keeps all its sites active.What should happen
When no active rule funds
fedwiki_sitesfor an organization's pool (the place its limits and usage are counted), the sweep makes the pool's active sites read-only, as it does for a surplus under a rule set to "Force reduce". The content is kept, and the sites come back when a plan funds them again."Leave the surplus alone" is a promise a rule makes to an organization that still has a plan. With no rule left, nobody has made that promise.
The fix makes removing a rule consequential for every organization that relied on it, so the preview an operator sees before committing a rule change has to count those organizations and say what happens to their sites.
Where
internal/integrations/fedwiki/workflows/reconcile.go,reconcilePoolQuota: parks only when the governing policy readsforce_reduce, and reads no policy when nothing funds the key.internal/entitlements/queries/entitlement_set_rules.sql,GetGoverningReductionPolicy: returns no row for a key no active rule funds.openspec/specs/fedwiki-sites/spec.md, the requirement that the quota sweep "SHALL NOT park unconditionally": it names what the sweep does under each policy and is silent on a limit no rule funds.internal/integrations/fedwiki/workflows/reconcile_db_test.go,TestReconcileUngovernedParksNothing: asserts the current behaviour and changes with the fix.Steps
fedwiki_siteslimit of 3 with the reduction policy "Force reduce", and create 3 sites.fedwiki_sitesrule, or that the type has no default plan.The limit reads 0 and the 3 sites are still active.
If the default plan does carry a
fedwiki_sitesrule set to "Force reduce", the sweep parks the surplus as expected. That is the only configuration in which a plan's end reaches the sites today.Why it matters
A member who pays once and then cancels keeps every site they made in full use, for nothing. An operator has to know to give the default plan a
fedwiki_sitesrule of 0 set to "Force reduce" to prevent it, and an operator who configures nothing gives the service away.Three things found after filing. They mean the fix described above should not go into the sweep alone.
internal/fulfillment/reconcile.go, wherepast_due,unpaidandpausedare classed as suspended), and a suspended subscription funds nothing. The default plan is not restored while a plan is suspended, because a suspended plan still counts as held (docs/models/plan-ladders-transitions.md, where restoration is described as a floor). With the fix as written, a card that fails at renewal would make every site read-only at once, including the sites the default plan allows. A member whose card failed would be treated worse than a member who cancelled.fedwiki_sitesrule whose reduction policy is anything other than "Force reduce", every site stays active after a plan ends, because the sweep reads the policy of the rules that remain. A new rule opens on "Clamp" (#105). An explicit rule of 0 sites on the default plan therefore leaves a member more than no rule at all.So this needs one decision on what a plan's end, a downgrade and a failed payment each do to existing sites, and the sweep follows from it.