chadtmiller.com/group-host
atmosphere group host
0
0
Groups are switched off, back on, and deleted
Merged Approved
This adds deactivateGroup, activateGroup and deleteGroup over the existing account lifecycle. It adds a deactivation table that keeps the stewards, and it deletes a group whose setup failed partway. The latest head (08b4c685) passes check, test (with the 100% gate), web and lexicons. The earlier run on e8e995cc failed only because it conflicted with main, and the new head no longer conflicts.
I read group_lifecycle.rs, lifecycle.rs and the store's deactivate, activate and delete_account. I did not read the whole 59k-character diff, so the tests and docs are not reviewed line by line. The authorization logic looks right:
- The stewards are read before the group goes dark.
- The deactivate and delete steps each run in one transaction that also writes the
#accountevent. - A tombstone that fails is logged and reported as
tombstoned: false, not turned into a failed delete.
Two small notes, neither blocking:
deactivate_groupchecksdeactivation().is_some(), thensteward, thenconfigurers, thendeactivate_account.Store::deactivatereturns false when the group is already off, but the handler ignores that result. If two requests race, the second returns{}without an error. The same applies toactivate_group. You could mapfalseto theAlreadyDeactivated/NotDeactivatederrors.deleteGrouptells the syncing services before it deletes anything. If the delete then fails, those services have been told of a deletion that didn't happen. That seems acceptable for best-effort notices, but the doc comment could say so.
Merged as c39222e
What changes
A group can be switched off, back on, and deleted. These are new methods in
group_lifecycle.rs, overlifecycle.rs, which does the same to any account.fyi.opensocial.deactivateGroup(needsgroup.configure) switches the group off:#account {active: false, status: "deactivated"}.RepoDeactivatedinsync.getRepo,getLatestCommit,repo.*andgetBlob, and inlistReposit showsactive: false, status: "deactivated". Its repos in spaces read asRepoDeactivatedtoo.getGroupandlistGroupsshow it asdeactivatedand nothing more.group.configureat that moment is kept in a newdeactivationtable, since its memberships can't be read while it's off.fyi.opensocial.activateGroupswitches it back on, for one of those stewards.fyi.opensocial.deleteGroupdeletes it. While it's on, that takesgroup.configure; while it's off, one of the stewards kept when it went off.notifySpaceDeleted, best effort, signed by the group while it still has a key.#account {status: "deleted"}.{tombstoned}.A group whose setup fails partway is deleted, so its handle is free again. This answers the groups pull's review.
Why
This is the next part of 4d, following the prototype's
methods/lifecycle.ts. It differs in two ways:How it was checked
tests/lifecycle.rscovers:listRepos's status; no writes as it;mayfalse; its space repo refused;getGroupnot found;did:webcan't be a record key.The fake PLC now serves
/log/last.just covis at 100% of lines and functions, and clippy is clean.Shortcomings
tombstonedsays so.🤖 Generated with Claude Code