Skip to content

feat(pds): implement com.atproto.sync.getLatestCommit#168

Merged
ascorbic merged 2 commits into
ascorbic:mainfrom
simnaut:feat/sync-get-latest-commit
May 24, 2026
Merged

feat(pds): implement com.atproto.sync.getLatestCommit#168
ascorbic merged 2 commits into
ascorbic:mainfrom
simnaut:feat/sync-get-latest-commit

Conversation

@simnaut
Copy link
Copy Markdown
Contributor

@simnaut simnaut commented May 23, 2026

Closes #167

What this is

A spec-conformance fix: com.atproto.sync.getLatestCommit has no route, so requests fall through to the catch-all XRPC proxy and return 501 MethodNotImplemented. It's a standard sync endpoint and should return 200.

Note: this is not the relay-indexing fix. Investigation (see #167) showed no relay's crawl depends on getLatestCommit — indigo and rsky-relay build state from the firehose. The actual cause of cirrus repos freezing on relays is missing prevData in #commit events, fixed separately in #169 / #170. This PR is conformance cleanup.

Change

  • Add a getLatestCommit handler in packages/pds/src/xrpc/sync.ts, mirroring getRepoStatus for did validation / RepoNotFound / deactivated handling. It returns { cid, rev } (the lexicon output) sourced from AccountDurableObject.rpcGetRepoStatus() — the same data already used by getRepoStatus/listRepos.
  • Register the route in packages/pds/src/index.ts before the catch-all proxy.
  • Add unit tests (success, missing did → 400, unknown did → 404).
  • Changeset (minor).

Verification

  • pnpm --filter @getcirrus/pds build
  • pnpm --filter @getcirrus/pds test:unit ✅ (282 passed)
  • pnpm knip

🤖 Generated with Claude Code

The endpoint was unimplemented, so requests fell through to the XRPC proxy
and returned 501. Relays call getLatestCommit during crawl bootstrap, so a
freshly created repo could never be indexed by a fresh requestCrawl. It now
returns the repo head commit { cid, rev } from rpcGetRepoStatus.

Closes ascorbic#167

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/create-pds@168
npm i https://pkg.pr.new/@getcirrus/oauth-provider@168
npm i https://pkg.pr.new/@getcirrus/pds@168

commit: ed1dbb5

@ascorbic ascorbic merged commit 71b988e into ascorbic:main May 24, 2026
4 checks passed
@mixie-bot mixie-bot Bot mentioned this pull request May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

com.atproto.sync.getLatestCommit returns 501, blocking relay crawl

2 participants