···1use crate::db::{self, keys};
02use crate::ingest::{BufferRx, IngestMessage};
3use crate::ops;
4use crate::resolver::{NoSigningKeyError, ResolverError};
···501 repo_state,
502 &commit,
503 Self::fetch_key(ctx, did)?.as_ref(),
0504 )?;
505 let repo_state = res.repo_state;
506 *ctx.added_blocks += res.blocks_count;
···526 ) -> Result<RepoProcessResult<'s, 'c>, IngestError> {
527 let repo_key = keys::repo_key(&did);
528 let Some(state_bytes) = ctx.state.db.repos.get(&repo_key).into_diagnostic()? else {
529- // we don't know this repo, but we are receiving events for it
530- // this means we should backfill it before processing its events
0000000000000000531 debug!("discovered new account {did} from firehose, queueing backfill");
532533 let repo_state = RepoState::backfilling(rand::rng().next_u64());
534- // using a separate batch here since we want to make it known its being backfilled
535- // immediately. we could use the batch for the unit of work we are doing but
536- // then we wouldn't be able to start backfilling until the unit of work is done
537 let mut batch = ctx.state.db.inner.batch();
538 batch.insert(
539 &ctx.state.db.repos,
···18 if (wait-for-api $url) {
19 # Trigger backfill to populate some data
20 print $"adding repo ($did) to tracking..."
21- http post -t application/json $"($url)/repo/add" { dids: [($did)] }
2223 if (wait-for-backfill $url) {
24 print "backfill complete, testing debug endpoints"
···18 if (wait-for-api $url) {
19 # Trigger backfill to populate some data
20 print $"adding repo ($did) to tracking..."
21+ http patch -t application/json $"($url)/filter" { dids: { ($did): true } }
2223 if (wait-for-backfill $url) {
24 print "backfill complete, testing debug endpoints"
+1-1
tests/repo_sync_integrity.nu
···112 if (wait-for-api $url) {
113 # track the repo via API
114 print $"adding repo ($did) to tracking..."
115- http post -t application/json $"($url)/repo/add" { dids: [($did)] }
116117 if (wait-for-backfill $url) {
118 # Run both consistency checks
···112 if (wait-for-api $url) {
113 # track the repo via API
114 print $"adding repo ($did) to tracking..."
115+ http patch -t application/json $"($url)/filter" { dids: { ($did): true } }
116117 if (wait-for-backfill $url) {
118 # Run both consistency checks
+1-1
tests/stream_test.nu
···3132 # trigger backfill
33 print $"adding repo ($did) to tracking..."
34- http post -t application/json $"($url)/repo/add" { dids: [($did)] }
3536 if (wait-for-backfill $url) {
37 sleep 2sec