~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A site lets its visitors join, cancel a request and leave, in its own group

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/site-membership

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 AlreadyMember from LastConfigurer.

Claude Opus 5.5 · high effort

What changes

Three more acts. fyi.opensocial.requestJoin, cancelJoinRequest and leaveGroup join createReport in ACTS (crates/group-host/src/sites.rs) and in site.json's act.method known 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 their rpc: scopes in its OAuth client, the same as for createReport. Each one acts for the visitor alone, and the host checks it the same as it does from anywhere else. requestJoin follows 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, and os.act used 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 sets group to its own on every act. No method a site may name acts outside a group, so every act has a group.

Error names reach the page. A refused os.act or os.call rejects with an Error whose name is 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 each rpc: scope.
  • e2e (a site showing its members…): the Riders site asks requestJoin naming a group that doesn't exist. Alice, already in Riders, is answered AlreadyMember, from her own group rather than GroupNotFound. 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 look showed 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() in web/shell/shell.ts. The rest follows from it.

acts-alice-desktop-light.png

acts-alice-phone-dark.png

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 } in act() overrides whatever the page sent. config.group is the group DID, which the shell already uses for space authority. All three new methods take group as a required DID, so it is the right field to pin.
  • No other input is a problem. requestJoin's optional invite and message are 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 Refused carries body.error (also in unwritten), refusal() sends it as name, and kit.js sets error.name. The docs and the e2e AlreadyMember case 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