chadtmiller.com/group-host
atmosphere group host
0
0
A site lets its visitors join, cancel a request and leave, in its own group
Merged Approved
This pull adds requestJoin, cancelJoinRequest and leaveGroup to the acts a site may name. The host's page now forces group to the site's own group on every os.act. A refused ask also carries the method's error name to the page. I read every changed file and the three lexicons. I did not run the checks.
- The pin is sound.
{ ...input, group: config.group }inact()overrides whatever the page sent.config.groupis the group DID, which the shell already uses for space authority. All three new methods takegroupas a required DID, so it is the right field to pin. - No other input is a problem.
requestJoin's optionalinviteandmessageare about the visitor's own request, and the host checks them as it does anywhere else. - The error name goes from the XRPC body to the page. The shell's
Refusedcarriesbody.error(also inunwritten),refusal()sends it asname, andkit.jssetserror.name. The docs and the e2eAlreadyMembercase cover it. - The tests, docs, lexicon values, consent text and publish dialog all match the new acts.
One thing you could do later: ...input on a non-object, such as an array or a string from a page, gives odd JSON. That is harmless because group is still set, and the host rejects the rest.
Merged as a3cae3b
A group's site can now let its visitors join the group, ask to join, cancel the request, and leave, without sending them to the console. The host's page always asks these of the site's own group, whatever the site's code sends, and it passes the method's error name to the page, so a site can tell
AlreadyMemberfromLastConfigurer.Claude Opus 5.5 · high effort
What changes
Three more acts.
fyi.opensocial.requestJoin,cancelJoinRequestandleaveGroupjoincreateReportinACTS(crates/group-host/src/sites.rs) and insite.json'sact.methodknown values. The console's publish dialog gets a checkbox for each: "Join the group, or ask to join", "Cancel their request to join", "Leave the group". A site that names them gets theirrpc:scopes in its OAuth client, the same as forcreateReport. Each one acts for the visitor alone, and the host checks it the same as it does from anywhere else.requestJoinfollows the group's join policy, and redeems an invite waiting for the visitor.Pinned to the site's group. The visitor's
rpc:scope covers every group on the host, andos.actused to send the page's input unchanged. A site could therefore act for its visitors in another group: file reports into another group's queue, or now, ask to join it. The host's page (web/shell/shell.ts) now setsgroupto its own on every act. No method a site may name acts outside a group, so every act has agroup.Error names reach the page. A refused
os.actoros.callrejects with anErrorwhosenameis the method's error name when it gave one (AlreadyMember,JoinClosed,LastConfigurer). Before, only the message reached the page, and pages are not to read messages.Why
Kicker's join policy is
approval, but someone signed in there who wasn't a member had no way to ask, and a member had no way to leave. Both were only in the console. The alternative, linking to the console's group page, sends people away from the site to do the one thing its landing is for.How it was checked
tests/sites.rs: a site naming all four acts is published, the page is told them, and its client asks for eachrpc:scope.a site showing its members…): the Riders site asksrequestJoinnaming a group that doesn't exist. Alice, already in Riders, is answeredAlreadyMember, from her own group rather thanGroupNotFound. That shows the page set the group, and that the error name reached the page.just lex, svelte-check, the layer check and the docs check pass.just lookshowed the publish dialog's new checkboxes, desktop light and phone dark.Shortcomings
A site may still ask to join as soon as someone signs in, without a click. Under
open, that makes them a member at once. It's only ever the group whose site it is, the consent screen lists the method, and they can leave.Review
The pin is one line in
act()inweb/shell/shell.ts. The rest follows from it.