snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy
Creative Commons Zero v1.0 Universal
562 stars 30 forks source link

xrpc: Wrong error type returned when repo is not found #1083

Closed mackuba closed 3 months ago

mackuba commented 4 months ago

Testing on getLatestCommit at least - when called with a DID of a repo that doesn't exist (was deleted?), it returns:

https://atproto.brid.gy/xrpc/com.atproto.sync.getLatestCommit?did=did:plc:qwerty

{
    "error": "InvalidRequest",
    "message": "Repo None not found"
}

On Bluesky servers, it returns:

https://amanita.us-east.host.bsky.network/xrpc/com.atproto.sync.getLatestCommit?did=did:plc:qwerty

{
    "error": "RepoNotFound",
    "message": "Could not find root for DID: did:plc:qwerty"
}

The error type seems to be specified in the lexicon:

https://github.com/bluesky-social/atproto/blob/main/lexicons/com/atproto/sync/getLatestCommit.json#L30

"errors": [{ "name": "RepoNotFound" }]
snarfed commented 4 months ago

Good point, thanks!

snarfed commented 3 months ago

Done!