Skip to main content

get_repo

Function get_repo 

Source
pub(crate) async fn get_repo(
    __arg0: State<AppState>,
    peer: Peer,
    headers: HeaderMap,
    query: Result<Query<GetRepoQuery>, QueryRejection>,
) -> Response
Expand description

GET /xrpc/com.atproto.sync.getRepo

The whole repository as a CARv1 file: a signed commit over a Merkle search tree over every record. This is the only answer this server gives that a reader does not have to take on trust — resolve the DID, take the key out of the document, check the signature.

since is a revision the caller last synced at, and the answer is then the blocks it does not already hold — the same commit at the root either way. A revision this deployment cannot place, because it never minted it or has since trimmed it out of that repository’s trail, is answered with the whole repository rather than with an error: the caller asked what it is missing, and all of it is true. See didbot_pds::history.

It is answered with the whole repository and said so, in SINCE. A full export and a delta are both a CAR rooted at the current commit, so a caller comparing bytes cannot tell one from the other, and one that cannot tell cannot notice it is paying for a full export on every reconnect. The lexicon declares no error for this and its output encoding is a CAR, so a header is the only place the fact fits without this server answering something com.atproto.sync.getRepo does not define.