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

Apps and sites make a person's invite inbox when they sign in

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:sdk/invite-inbox

What changes

The SDK. InviteInbox.open(session) in @opensocial/sdk makes the signed-in person's invite inbox, at://<did>/space/fyi.opensocial.invites/self, at their own PDS with com.atproto.space.createSpace (lex-space's SpaceClient.createSpace), policy com.atproto.memberspace.policy with publicWrite and no members. On SpaceAlreadyExists it reads the policy with getSpace and opens the inbox as it is, never changing it; fits says whether that policy is an inbox's, so one made elsewhere with another policy is left alone and reported. sync() and invites() read the fyi.opensocial.invite records groups wrote there, each with the group that wrote it, through GroupSpace.

Sites. A site may set inbox (fyi.opensocial.site, putSite, opensocial site publish --inbox, site_publish, and a checkbox under Advanced in the console's publish dialog). The page around it then asks for space:fyi.opensocial.invites?action=read_self&manage=create and, as the visitor comes back from signing in, makes their inbox with InviteInbox.open. A site with only inbox is served in that page too.

Kicker publishes with --inbox, so each visitor who signs in gets an inbox; its e2e checks erin has none before, and one with publicWrite after.

Docs. The SDK reference and README, sites (scope, field, CLI), membership's Invites (who makes the inbox now), the API, CLI and MCP references.

Why

The proposal has each person's app make their inbox, and nothing here did: groups wrote invites into inboxes nobody had made. The scope is the spaces permission spec's: manage=create for createSpace, and read_self for getSpace on an inbox already there, with nothing in it read. A site has no OAuth client of its own, so the host's page around it is what asks and makes it, from a field of the site's record, as it does for reads and writes.

How it was checked

  • packages/sdk/src/invite-inbox.test.ts: made when missing (the createSpace body), opened as it is when there, left alone and fits false for three other policies, other refusals passed on, and invites read from a group's repo in the inbox.
  • crates/group-host/tests/sites.rs: a site with inbox is served in the shell with inbox: true, its client metadata asks for the scope, and the record keeps it. crates/opensocial/tests/commands.rs: --inbox.
  • Kicker's e2e (outside the checks), run locally once against the alpha PDS at harness/alpha.sh's commit: all 10 flows pass, with erin having no inbox before signing in and a memberspace publicWrite one after, so the PDS grants the scope and createSpace through the site's OAuth session.
  • just look of the publish dialog's new Advanced part (checked, from a site published with --inbox), desktop and phone, light and dark.
  • CI: check, test (100% gate), web, lexicons, e2e, docs.

Shortcomings

  • The console makes no inbox for whoever signs in to it; its own sign-in scopes are out of this pull. Someone whose apps never made one still sees their invites in the console from the host's list.
  • The shell makes the inbox only as the visitor comes back from signing in, not for a session restored from before the site set inbox (that session also lacks the scope; it logs and goes on).
  • fits reads the policy alone; it does not list an existing memberspace inbox's members.

inboxend-alice-desktop-light.png

inboxend-alice-phone-dark.png

Approved

This adds InviteInbox.open to the SDK. It creates the signed-in person's fyi.opensocial.invites/self space with a publicWrite memberspace policy. If the space already exists, it reads the policy with getSpace and leaves it alone. A site can now set inbox. That field is carried through the lexicons, putSite, the CLI, the MCP tool and the console checkbox. It adds the space:fyi.opensocial.invites?action=read_self&manage=create scope to the site's client metadata. It also makes the shell create the inbox as the visitor returns from signing in.

I read the Rust, shell, SDK and server-side changes and found nothing wrong. Error handling in open is correct: only SpaceAlreadyExists falls through to getSpace, and other refusals propagate. The shell logs a failure and carries on, so a missing scope or a bad policy cannot break sign-in. I did not read the docs, tests, Kicker, lexicon or Svelte/messages diffs. The web, check, lexicons and docs workflows pass. The test and e2e runs were still going when I looked, so I could not judge them.

Minor, not blocking: opensocial site publish strips every --inbox word before parsing. A positional argument literally named --inbox would be dropped, but that is a very unlikely input.

The shortcomings the body lists are reasonable and clearly stated.

Merged as 34a5cb7