at protocol indexer with flexible filtering, xrpc queries, and a cursor-backed event stream, built on fjall
at-protocol atproto indexer rust fjall

[api] fix DbRkey deserialization in list_records

ptr.pet 6ad49bbc 2a4c0a2c

verified
+11 -1
+11 -1
src/api/xrpc.rs
··· 188 188 break; 189 189 } 190 190 191 - let rkey: DbRkey = rmp_serde::from_slice(&key[prefix.len()..]).into_diagnostic()?; 191 + // manual deserialization of the key suffix since it is raw bytes, not msgpack 192 + let suffix = &key[prefix.len()..]; 193 + let rkey = if suffix.len() == 8 { 194 + let mut bytes = [0u8; 8]; 195 + bytes.copy_from_slice(suffix); 196 + DbRkey::Tid(crate::db::types::DbTid::new_from_bytes(bytes)) 197 + } else { 198 + let s = String::from_utf8_lossy(suffix); 199 + DbRkey::Str(smol_str::SmolStr::from(s.as_ref())) 200 + }; 201 + 192 202 // look up using binary cid bytes from the record 193 203 if let Ok(Some(block_bytes)) = blocks_ks.get(&cid_bytes) { 194 204 let val: Data = serde_ipld_dagcbor::from_slice(&block_bytes).unwrap_or(Data::Null);