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

A group's address comes from its name as it is typed

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:web/new-group

What changes

A group's address comes from its name as it's typed, as in the prototype. The form for starting a group takes the name first. The address beside the host's domain (riders · .groups.test) is made from it as you type: lowercase, accented letters as the letters, dashes between words. Once you change the address by hand, it stays as you put it. Once typing stops, the form asks whether that address is taken, and if so offers the next free one (Use riders-2.groups.test).

The action makes the label the same way again, so a page drawn without script still sends a proper one, and builds the handle from the label and the host's domain.

An address a group keeps is taken. A group that takes a handle on a domain of its own keeps its address here, and no new group may take that address. Starting a group checked only handles, though. So such an address passed the check, a DID was registered with the directory for it, and storing it then failed on the address's unique key: a 500, with the DID left orphaned. It's now refused as taken (HandleTaken) before anything goes to the directory.

fyi.opensocial.checkAddress answers, for anyone, whether an address under this host's domain is free: neither an account's handle here nor kept as a group's address. The form asks it rather than resolveHandle, which knows only handles and would call a kept address free.

The host answers com.atproto.server.describeServer, as any PDS does: its DID, the domain it names its groups under (availableUserDomains), that nobody signs up here (inviteCodeRequired: true), and its blob limit. Its lexicon is copied into lexicons/upstream from the alpha atproto commit CI builds.

Why

You asked for the prototype's flow, where the address is guessed from the name and changed only if it isn't what you want. The console had no way to know the host's domain; describeServer is how a PDS says it.

How it was checked

  • Host: repos.rs tests describeServer's answer. groups.rs moves a group to a handle of its own and checks that its address stays taken, both for checkAddress and for starting a group, and that a name not one label under the domain is refused. Without the fix, that test gets the 500.
  • Console: the "starting a group" flow types the name and sees the address made from it under the domain. It sees a second Hikers' address said to be taken, with hikers-2 offered, and the host still refusing it when sent. It also sees an address typed by hand stay as typed when the name is filled after.
  • All 24 e2e flows pass on my machine, and svelte-check passes.

Review

This builds on at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzj2azz2bstb (just dev redrawing as you go), itself on at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzizs4jaoswn (the look); their commits show here until they merge.

🤖 Generated with Claude Code

Approved

This pull makes the new-group form build the address from the name as it's typed. It adds a describeServer answer on the host so the console knows the domain. The action rebuilds the handle from label plus that domain, so a page drawn without script still works.

I read the parts this pull is about: describe_server and its route and test, handles.ts, NewGroupForm.svelte, and the /new page and its server load and action. I didn't review the other files in the diff, which are the look and just dev changes from the two pulls this one builds on (restyled components, app.css and tokens.css, the sign-in dialog, the harness). I'm judging those on their own pulls. I also didn't read the e2e flows or the describeServer.json lexicon copy.

I found nothing that must change.

  • labelOf and finished are consistent with each other, and the action trims a trailing dash again.
  • The availability check treats a failed lookup as "free", which is the safe way round. The host still refuses a taken handle when the form is sent.
  • Minor: if describeServer returned an empty availableUserDomains, domainOf would give undefined and the handle would become ...undefined. The host always sends one entry, so this is only a robustness note.
Approved

This round adds one commit, d327e02, which makes a kept group address count as taken. I read it, plus the files it touches: held_here, check_address, the groups.rs test, the checkAddress lexicon, and the form and server action that now call it. I found nothing that must change.

  • held_here checks both a handle and a kept address, and create_account uses it before anything goes to the directory. That closes the orphaned-DID 500 you described. check_address lowercases its input and refuses anything that isn't exactly one label under the domain. addressed lowercases too, so case can't slip past.
  • The form now asks checkAddress. A failed lookup counts as free, and the host still refuses a taken address on submit, which is the safe way round.
  • The test covers the moved-group case and the non-label cases.

My earlier note about an empty availableUserDomains still stands, as a robustness point only.

Not code: the pull's compare shows a conflict with the base in web/src/app.css and web/src/lib/organisms/SignInDialog.svelte. Those come from the stacked pulls, so it will likely clear once they merge. Rebase if it doesn't.

I did not re-read the look and just dev files from the stacked pulls.

Approved

This round only merges main into the branch. The two stacked pulls have landed, and the conflict I mentioned last round is resolved. The pull now fast-forwards. Nothing in the pull's own code (the address from the name, checkAddress, held_here, describeServer) has changed since the d327e02 round, where I found nothing that must change. I did not re-read the merged look and just dev files.

My earlier robustness note still stands and is not blocking: an empty availableUserDomains would make domainOf return undefined.

Merged as 6f21135