diff --git a/lexicons/com/atproto/sync/getRepo.json b/lexicons/com/atproto/sync/getRepo.json index 87ecaa1f796..6bb6de2b1e4 100644 --- a/lexicons/com/atproto/sync/getRepo.json +++ b/lexicons/com/atproto/sync/getRepo.json @@ -16,7 +16,6 @@ }, "since": { "type": "string", - "format": "cid", "description": "The revision of the repo to catch up from." } } diff --git a/lexicons/com/atproto/sync/listBlobs.json b/lexicons/com/atproto/sync/listBlobs.json index 01e01391256..9f25b1330a6 100644 --- a/lexicons/com/atproto/sync/listBlobs.json +++ b/lexicons/com/atproto/sync/listBlobs.json @@ -16,7 +16,6 @@ }, "since": { "type": "string", - "format": "cid", "description": "Optional revision of the repo to list blobs since" }, "limit": { diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index c49b098002b..6f1cef89925 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -3149,7 +3149,6 @@ export const schemaDict = { }, since: { type: 'string', - format: 'cid', description: 'The revision of the repo to catch up from.', }, }, @@ -3178,7 +3177,6 @@ export const schemaDict = { }, since: { type: 'string', - format: 'cid', description: 'Optional revision of the repo to list blobs since', }, limit: { diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index c49b098002b..6f1cef89925 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -3149,7 +3149,6 @@ export const schemaDict = { }, since: { type: 'string', - format: 'cid', description: 'The revision of the repo to catch up from.', }, }, @@ -3178,7 +3177,6 @@ export const schemaDict = { }, since: { type: 'string', - format: 'cid', description: 'Optional revision of the repo to list blobs since', }, limit: { diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index c49b098002b..6f1cef89925 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -3149,7 +3149,6 @@ export const schemaDict = { }, since: { type: 'string', - format: 'cid', description: 'The revision of the repo to catch up from.', }, }, @@ -3178,7 +3177,6 @@ export const schemaDict = { }, since: { type: 'string', - format: 'cid', description: 'Optional revision of the repo to list blobs since', }, limit: { diff --git a/packages/pds/tests/sync/sync.test.ts b/packages/pds/tests/sync/sync.test.ts index 73947eddbc3..27311cbf81d 100644 --- a/packages/pds/tests/sync/sync.test.ts +++ b/packages/pds/tests/sync/sync.test.ts @@ -118,6 +118,39 @@ describe('repo sync', () => { expect(commit.data.cid).toEqual(currRoot?.toString()) }) + it('syncs `since` a given rev', async () => { + const repoBefore = await repo.Repo.load(storage, currRoot) + + // add a post + const { obj, uri } = await makePost(sc, did) + if (!repoData[uri.collection]) { + repoData[uri.collection] = {} + } + repoData[uri.collection][uri.rkey] = obj + uris.push(uri) + + const carRes = await agent.api.com.atproto.sync.getRepo({ + did, + since: repoBefore.commit.rev, + }) + const car = await repo.readCarWithRoot(carRes.data) + expect(car.blocks.size).toBeLessThan(10) // should only contain new blocks + const synced = await repo.verifyDiff( + repoBefore, + car.blocks, + car.root, + did, + ctx.repoSigningKey.did(), + ) + expect(synced.writes.length).toBe(1) + await storage.applyCommit(synced.commit) + const loaded = await repo.Repo.load(storage, car.root) + const contents = await loaded.getContents() + expect(contents).toEqual(repoData) + + currRoot = car.root + }) + it('sync a record proof', async () => { const collection = Object.keys(repoData)[0] const rkey = Object.keys(repoData[collection])[0]