Something went wrong. Try again.
This string has no description
Something went wrong. Try again.
3.9 kB · 84 lines · Created 2mo ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485# Make pds.js work with bulleted.app (spaces)
Most changes are not new features. Proposal 0016 changed names afterimplementations shipped. Two names are now in use for several requests. Ourserver implemented one name of each pair.
## The missing method
The server did not serve `community.lexicon.service.describe`. This method takesno parameters and needs no authentication. It returns the roles of the service.It also returns every XRPC method the server routes.
```json{"roles":["pds"], "methods":[{"$type":"community.lexicon.service.describe#nsid", "value":"com.atproto.space.listSpaces"}, …]}```
A client calls this method to find optional features. Without it the clientcannot separate two cases. The first case is a server that does not implementspaces. The second case is a failed read. Bulleted stops at this point.
This method is easy to miss. It is not in atproto core. It is not in proposal0016. It is a `community.lexicon.*` NSID. The lexicon-community repository doesnot publish the schema yet. The atproto-crates server implements it. That is theonly implementation I found, and bulleted.app works against it. Its source givesthe reason:
> A method this server does not route answers `501 MethodNotImplemented`, which> from outside is indistinguishable from a method that is routed and broken.
Build the list from the route table when the request runs. Do not keep aseparate constant. The list then always agrees with the routes. The list alsonames the space methods only when spaces are on. Exclude the proxied`app.bsky.*` methods. Those methods belong to the AppView.
## Two names for the same request
Accept both names in each row.
| Newer name (atproto PR #5187) | Older name (atproto-crates) ||---|---|| `com.atproto.simplespace.getSpace` | `com.atproto.space.getSpace` || `com.atproto.space.getLatestCommit` | `com.atproto.space.getRepoState` || `createSpace` with required `policy` and `appAccess` unions | a nested `config` with a string `policy`, or the older `mintPolicy`, and a sibling `managingApp` || no `did` on `createSpace` | an optional `did` that must equal the caller || `applyWrites` writes tagged `$type` | writes named by an `action` string |
Both config fields are optional in the older form. A missing field takes thedefault. The default policy is `member-list`. The default app access is `#open`.An `rkey` of `""` asks the server for a new key.
`getSpace` must return the union fields and the `#spaceConfig` object together.The client then reads the form it knows.
## Two defects
An unknown XRPC method must answer 501 with a `MethodNotImplemented` body. Ourserver answered 404 with `text/plain`. A client cannot read a 404 as an answer.
`createSpace` must add the owner to the member list. `member-list` is thedefault policy. `getSpaceCredential` refuses a caller who is not a member. Anowner therefore received a 403 for a new space. We found this defect last. Itwas the most difficult one to find. The error appears on a read. The cause is inthe create.
## One client behaviour
The space write from Bulleted failed. Bulleted then called`com.atproto.repo.createRecord`. That record went to the public repository and tothe firehose. The user had typed "Private data!" into that record.
Check your public repository for the collection of the application. Tell thedeveloper about this behaviour. A private write that fails must fail.
## What we added beyond compatibility
We added `getBlob`, `listBlobs`, and `unregisterNotify`. We added the readparameters of `listRecords` and `getRepo`. `registerNotify` now reads theendpoint from the DID document of the subscriber. It no longer trusts a URL inthe request body. `getSpace` now authorizes the caller. It names the memberpolicy and the allowed client IDs. Any caller could read it before. Our spacemethods are now a superset of the atproto-crates methods.