Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
0

Configure Feed

Select the types of activity you want to include in your feed.

did filter: memstore

it works

+21 -4
+7 -2
constellation/src/storage/mem_store.rs
··· 303 303 }); 304 304 }; 305 305 306 + let did_rkeys: Vec<_> = did_rkeys 307 + .into_iter() 308 + .flatten() 309 + .filter(|(did, _)| dids.contains(did)) 310 + .collect(); 311 + 306 312 let total = did_rkeys.len(); 307 313 let end = until 308 314 .map(|u| std::cmp::min(u as usize, total)) ··· 310 316 let begin = end.saturating_sub(limit as usize); 311 317 let next = if begin == 0 { None } else { Some(begin as u64) }; 312 318 313 - let alive = did_rkeys.iter().flatten().count(); 319 + let alive = did_rkeys.iter().count(); 314 320 let gone = total - alive; 315 321 316 322 let items: Vec<_> = did_rkeys[begin..end] 317 323 .iter() 318 324 .rev() 319 - .flatten() 320 325 .filter(|(did, _)| *data.dids.get(did).expect("did must be in dids")) 321 326 .map(|(did, rkey)| RecordId { 322 327 did: did.clone(),
+14 -2
constellation/src/storage/mod.rs
··· 860 860 RecordId { 861 861 did: "did:plc:linker".into(), 862 862 collection: "app.t.c".into(), 863 - rkey: "asdf".into(), 863 + rkey: "asdf-2".into(), 864 864 }, 865 865 RecordId { 866 866 did: "did:plc:linker".into(), 867 867 collection: "app.t.c".into(), 868 - rkey: "asdf-2".into(), 868 + rkey: "asdf".into(), 869 869 }, 870 870 ], 871 871 next: None, ··· 893 893 }, 894 894 ], 895 895 next: Some(1), 896 + } 897 + ); 898 + 899 + let links = storage.get_links_from_dids("a.com", "app.t.c", ".abc.uri", 2, None, &HashSet::from([ 900 + Did("did:plc:someone-unknown".to_string()), 901 + ]))?; 902 + assert_eq!( 903 + links, 904 + PagedAppendingCollection { 905 + version: (0, 0), 906 + items: vec![], 907 + next: None, 896 908 } 897 909 ); 898 910 });