Repository navigation
fix(web): sync spaces with the 10-22 alpha's credential requests, MACs, and STAR repos - #235
Merged
Merged
Conversation
…s, and STAR repos The spaces alpha's 10-22 release changed how syncers talk to repo and space hosts, and PDSes on it reject the old Atproto-Space scheme, so space sync stopped. This moves every @atproto package to 0.0.0-spaces-alpha-20261022141228 and follows the new protocol: getSpaceCredential takes its delegation token in the body, requests use Atproto-Space-Credential, an authority's #atproto_pds is its space host, commits and records are checked with MACs derived from each author's #atproto_kem key, and full recovery reads STAR archives. Repeated space deletions are no-ops, and a recreated space resyncs from scratch.
A sync pass dropped a space, and now its booking thread too, on any SpaceDeleted or SpaceNotFound, including one from a writer's own repo host, so any member's PDS could make the app purge a space. Errors now carry the method that answered, and only SpaceDeleted from getSpaceCredential or SpaceDeleted/SpaceNotFound from listRepos, both answered by the authority, drop the space. Anything else is recorded on the repo and the space.
# Conflicts: # apps/web/README.md # apps/web/tests/integration/flows.test.ts
2 of 4 tasks
Coverage Report for apps/localtoolbox
File CoverageNo changed files found.SizeCompared with main. KiB are 1,024 bytes.
|
Coverage Report for apps/web
File Coverage
SizeCompared with main. KiB are 1,024 bytes.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Conflicts: # pnpm-lock.yaml # pnpm-workspace.yaml
# Conflicts: # apps/web/README.md
bnb
previously approved these changes
Oct 25, 2026
bnb
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The spaces alpha's 10-22 release changed how syncers talk to space and repo hosts. The root account's PDS (
spaces-alpha.host.bsky.network) runs it now and answers theAtproto-Spacescheme this app sends with400 InvalidToken: Unsupported authorization type: Atproto-Space, so space sync (audit, moderation, staff, bookings, press kits) fails./healthzdoesn't check sync, so it still says ok.This moves every
@atproto/*package from0.0.0-spaces-alpha-20261001173819to0.0.0-spaces-alpha-20261022141228and follows upstream's migration notes.Changed:
getSpaceCredentialgets{space, credentialKid, delegationToken}as a JSON body instead of a Bearer token and an HTTP signature.InvalidDelegationTokenis logged and keeps the watch;SpaceDeletedstill drops it.Atproto-Space-Credentialscheme.#atproto_pdsis its space host. The#atproto_space_hostlookup inidentity.tsis gone.listRepoOpspage,getRepo, and spacegetRecordasks for a MAC with a fresh key share against the author's#atproto_kemkey and checks it. On a MAC failure the DID document is re-resolved once and the request retried. An account that publishes no KEM key shows as a sync error that says so.onSpaceDeletedwaits out a running pass, then purges; repeats are no-ops, and a recreated space resyncs from scratch. The newbookings.forgetremoves a deleted booking space's thread so a recreated one starts clean.SpaceDeletedno longer drops the space; onlygetSpaceCredentialandlistRepos, which the authority answers, can.readSpaceRecordmoves fromapp.tsintocredentials.readRecord.Added: a
FakeSpaceHosttest helper that speaks the 10-22 protocol,credentials.test.ts, a repo-host suite inengine.test.ts, and an integration flow that deletes and recreates a booking space against the real 10-22 PDS.Re-resolving the overrides also moved
oxlint-tsgolintfrom 7.0.2003 to 7.0.2004 andlegacy-javascriptfrom 0.0.3 to 0.0.4 in the lockfile. The app doesn't follow the firehose, so a rotated KEM key is picked up when the DID document cache expires (5 minutes) or on the first MAC failure.How it was tested
pnpm test:integrationagainst the in-process 10-22 PDS, including the new deletion and recreation flowpnpm verify,pnpm test:coverage, andpnpm dev:networkwith every space syncingChecklist
apps/locallibrary/CHANGELOG.mdhas a line under Unreleased, if people using it will noticedocs/and--helpstill say what the code does