-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1705 from bluesky-social/pds-sqlite-refactor
Pds sqlite refactor
- Loading branch information
Showing
190 changed files
with
3,336 additions
and
5,421 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import AtpAgent from '@atproto/api' | ||
import { TestNetwork, SeedClient } from '@atproto/dev-env' | ||
import { CommitData } from '@atproto/repo' | ||
import { RepoService } from '@atproto/pds/src/services/repo' | ||
import { PreparedWrite } from '@atproto/pds/src/repo' | ||
import * as sequencer from '@atproto/pds/src/sequencer' | ||
import { cborDecode, cborEncode } from '@atproto/common' | ||
|
@@ -84,9 +83,8 @@ describe('sync', () => { | |
|
||
it('indexes actor when commit is unprocessable.', async () => { | ||
// mock sequencing to create an unprocessable commit event | ||
const afterWriteProcessingOriginal = | ||
RepoService.prototype.afterWriteProcessing | ||
RepoService.prototype.afterWriteProcessing = async function ( | ||
const sequenceCommitOrig = network.pds.ctx.sequencer.sequenceCommit | ||
network.pds.ctx.sequencer.sequenceCommit = async function ( | ||
did: string, | ||
commitData: CommitData, | ||
writes: PreparedWrite[], | ||
|
@@ -95,20 +93,19 @@ describe('sync', () => { | |
const evt = cborDecode(seqEvt.event) as sequencer.CommitEvt | ||
evt.blocks = new Uint8Array() // bad blocks | ||
seqEvt.event = cborEncode(evt) | ||
await sequencer.sequenceEvt(this.db, seqEvt) | ||
await network.pds.ctx.sequencer.sequenceEvt(seqEvt) | ||
} | ||
// create account and index the initial commit event | ||
await sc.createAccount('jack', { | ||
handle: 'jack.test', | ||
email: '[email protected]', | ||
password: 'password', | ||
}) | ||
await network.pds.ctx.sequencerLeader?.isCaughtUp() | ||
await network.processAll() | ||
// confirm jack was indexed as an actor despite the bad event | ||
const actors = await dumpTable(ctx.db.getPrimary(), 'actor', ['did']) | ||
expect(actors.map((a) => a.handle)).toContain('jack.test') | ||
RepoService.prototype.afterWriteProcessing = afterWriteProcessingOriginal | ||
network.pds.ctx.sequencer.sequenceCommit = sequenceCommitOrig | ||
}) | ||
|
||
async function updateProfile( | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.