diff --git a/hubble-sync/src/storage/repo/info.rs b/hubble-sync/src/storage/repo/info.rs index ae9ef0b..ce12c67 100644 --- a/hubble-sync/src/storage/repo/info.rs +++ b/hubble-sync/src/storage/repo/info.rs @@ -132,6 +132,10 @@ impl RepoInfo { .filter_map(|pair| match pair { Err(e) => Some(Err(LoadError::Storage(e))), Ok((key, value)) => { + // skip slots + if key.contains(&0x00) { + return None; + } let db: DbRepoInfo = match drisl::from_slice(&value) { Ok(db) => db, Err(e) => return Some(Err(e.into())), @@ -865,6 +869,18 @@ mod tests { }, ); + // an app slot colocated at `\x00u` (see info_slot): its bytes + // are not a DbRepoInfo (here, a bare CBOR uint) and the scan must skip + // it rather than try to decode it as repo info. + let slot_key = { + let mut k = DbRepoInfo::key(&plc('a')); + k.extend_from_slice(&[0x00, b'u']); + k + }; + let mut b = eng.batch(); + b.put(&slot_key, &[0x01]); + b.commit().unwrap(); + let mut found: Vec = RepoInfo::scan_out_of_scope(&eng) .map(|r| r.unwrap().as_str().to_string()) .collect();