π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
refactor(vecdb): remove unused snapshot compatibility changes
laurenspriem43fc8647fa56
diff --git a/rust/crates/vecdb/src/snapshot.rs b/rust/crates/vecdb/src/snapshot.rsindex d54a509713..8e5a095794 100644--- a/rust/crates/vecdb/src/snapshot.rs+++ b/rust/crates/vecdb/src/snapshot.rs@@ -8,7 +8,7 @@ use super::graph::{Graph, GraphNodeParts};use super::log::{remove_if_present, rename_with_windows_fallback, sync_parent_dir};const MAGIC: [u8; 4] = *b"EVDG";-const FORMAT_VERSION: u16 = 2;+const FORMAT_VERSION: u16 = 1;const NO_ENTRY_POINT: u32 = u32::MAX;const CRC_LEN: usize = 4;const FIXED_PREFIX_LEN: usize = 47;@@ -267,13 +267,13 @@ mod tests {use super::*;const GOLDEN: [u8; 94] = [- 0x45, 0x56, 0x44, 0x47, 0x02, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,+ 0x45, 0x56, 0x44, 0x47, 0x01, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00,0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,- 0xef, 0xb9, 0xf3, 0x93,+ 0x10, 0xe9, 0x5e, 0xe7,];fn golden_generation() -> [u8; 16] {@@ -411,7 +411,7 @@ mod tests {}#[test]- fn golden_bytes_pin_format_v2() {+ fn golden_bytes_pin_format_v1() {let dir = TempDir::new().unwrap();let written_path = dir.path().join("written");write_snapshot(&written_path, golden_generation(), 300, &golden_graph()).unwrap();@@ -616,17 +616,9 @@ mod tests {}#[test]- fn future_version_is_discarded() {+ fn bad_version_is_discarded() {assert_discarded(|bytes| {- bytes[4..6].copy_from_slice(&(FORMAT_VERSION + 1).to_le_bytes());- refresh_crc(bytes);- });- }-- #[test]- fn old_slot_mapping_version_is_discarded() {- assert_discarded(|bytes| {- bytes[4..6].copy_from_slice(&1u16.to_le_bytes());+ bytes[4..6].copy_from_slice(&2u16.to_le_bytes());refresh_crc(bytes);});}