Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Remove unused version key (#2159)

Leendert de Borst079fe9d43d0d
diff --git a/apps/browser-extension/src/utils/RustCore.ts b/apps/browser-extension/src/utils/RustCore.ts
index 5ca2108d9..0896fe25e 100644
--- a/apps/browser-extension/src/utils/RustCore.ts
+++ b/apps/browser-extension/src/utils/RustCore.ts
@@ -184,8 +184,8 @@ export type CodecTableData = { name: string; records: Array<Record<string, unkno
/** Manifest-v1 manifest. Forward-compat: unknown keys are preserved on round-trip. */
export type CodecManifest = {
schemaVersion: number;
+ /** Latest EF migration ID; readers derive the data-model version label from it. */
migrationId: string;
- version: string;
userSalt: string;
canonicalizedAt: string;
/** Set on a shared-folder manifest: the Folders.Id this manifest carries. Absent on a root manifest. */
@@ -240,7 +240,6 @@ export type CodecCanonicalizeInput = {
tables: CodecTableData[];
userSalt: string;
migrationId: string;
- version: string;
sharedFolders?: CodecSharedFolderSpec[];
canonicalizedAt: string;
};
diff --git a/apps/browser-extension/src/utils/VaultSyncService.ts b/apps/browser-extension/src/utils/VaultSyncService.ts
index 6a34b83bd..4761cb6ff 100644
--- a/apps/browser-extension/src/utils/VaultSyncService.ts
+++ b/apps/browser-extension/src/utils/VaultSyncService.ts
@@ -241,6 +241,9 @@ type CanonicalizedVaultSet = { canonicalized: CodecCanonicalized; sharedFolderRe
let canonicalizeCache: ({ client: SqliteClient; mutationSequence: number } & CanonicalizedVaultSet) | null = null;
+/**
+ * Drop the cached canonicalize result so the next push re-canonicalizes from the live SQLite state.
+ */
export function invalidateCanonicalizeCache(): void {
canonicalizeCache = null;
}
@@ -1072,7 +1075,6 @@ export class VaultSyncService {
tables,
userSalt,
migrationId,
- version: '2.0.0',
sharedFolders,
canonicalizedAt: new Date().toISOString(),
}));
diff --git a/apps/browser-extension/tests/helpers/manifest-v2-api.ts b/apps/browser-extension/tests/helpers/manifest-v2-api.ts
index 7d3cb2215..2d2526903 100644
--- a/apps/browser-extension/tests/helpers/manifest-v2-api.ts
+++ b/apps/browser-extension/tests/helpers/manifest-v2-api.ts
@@ -39,7 +39,6 @@ export type VaultSnapshot = {
export type DecryptedManifest = {
schemaVersion: number;
migrationId: string;
- version: string;
userSalt: string;
canonicalizedAt: string;
tables: Record<string, Array<Record<string, unknown>>>;
@@ -132,7 +131,6 @@ export async function pushManifest(
const payload = {
username: normalizeUsername(username),
- version: manifest.version,
manifestBlob,
manifestCiphertextHash,
currentManifestRevision: currentRevision,
diff --git a/core/rust/src/vault_codec/canonicalize.rs b/core/rust/src/vault_codec/canonicalize.rs
index 8b04da131..46eecb742 100644
--- a/core/rust/src/vault_codec/canonicalize.rs
+++ b/core/rust/src/vault_codec/canonicalize.rs
@@ -114,7 +114,6 @@ pub fn canonicalize_from_sqlite(input: CanonicalizeInput) -> VaultResult<Canonic
manifest: Manifest {
schema_version: SCHEMA_VERSION,
migration_id: input.migration_id.clone(),
- version: input.version.clone(),
user_salt: partition.user_salt,
canonicalized_at: input.canonicalized_at.clone(),
shared_folder_id: Some(partition.folder_id),
@@ -128,7 +127,6 @@ pub fn canonicalize_from_sqlite(input: CanonicalizeInput) -> VaultResult<Canonic
let manifest = Manifest {
schema_version: SCHEMA_VERSION,
migration_id: input.migration_id,
- version: input.version,
user_salt: input.user_salt,
canonicalized_at: input.canonicalized_at,
shared_folder_id: None,
diff --git a/core/rust/src/vault_codec/manifest.rs b/core/rust/src/vault_codec/manifest.rs
index f5aac5d8d..654505c68 100644
--- a/core/rust/src/vault_codec/manifest.rs
+++ b/core/rust/src/vault_codec/manifest.rs
@@ -16,8 +16,6 @@ pub struct Manifest {
pub schema_version: u32,
/// Latest EF migration ID.
pub migration_id: String,
- /// Human-readable data-model version label (e.g. "2.0.0").
- pub version: String,
/// Per-manifest salt for blob hashing (hex). For a shared-folder manifest this salt is shared by
/// every participant (it lives inside the encrypted manifest itself) so all of them compute the
/// same content-addressed blob hashes.
@@ -191,17 +189,11 @@ pub struct CanonicalizeInput {
pub tables: Vec<CodecTableData>,
pub user_salt: String,
pub migration_id: String,
- #[serde(default = "default_version")]
- pub version: String,
pub canonicalized_at: String,
#[serde(default)]
pub shared_folders: Vec<SharedFolderSpec>,
}
-fn default_version() -> String {
- String::from("2.0.0")
-}
-
/// Input for [`crate::vault_codec::materialize_as_sqlite`].
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/core/rust/src/vault_codec/sharing_tests.rs b/core/rust/src/vault_codec/sharing_tests.rs
index 0c1460cf6..476e36a99 100644
--- a/core/rust/src/vault_codec/sharing_tests.rs
+++ b/core/rust/src/vault_codec/sharing_tests.rs
@@ -35,7 +35,6 @@ fn input_with_shares(tables: Vec<CodecTableData>, shared_folders: Vec<SharedFold
tables,
user_salt: SALT_ROOT.to_string(),
migration_id: "20250101000000_Init".to_string(),
- version: "2.0.0".to_string(),
canonicalized_at: "2026-01-01T00:00:00.000Z".to_string(),
shared_folders,
}
diff --git a/core/rust/src/vault_codec/tests.rs b/core/rust/src/vault_codec/tests.rs
index 7d18ffbee..24457f7a7 100644
--- a/core/rust/src/vault_codec/tests.rs
+++ b/core/rust/src/vault_codec/tests.rs
@@ -27,7 +27,6 @@ fn basic_input(tables: Vec<CodecTableData>) -> CanonicalizeInput {
tables,
user_salt: "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff".to_string(),
migration_id: "20250101000000_Init".to_string(),
- version: "2.0.0".to_string(),
canonicalized_at: "2026-01-01T00:00:00.000Z".to_string(),
shared_folders: Vec::new(),
}
@@ -255,11 +254,9 @@ fn generate_user_salt_is_64_hex_chars() {
#[test]
fn forward_compat_unknown_manifest_fields_preserved() {
- // The plan's document-store rule: unknown top-level keys round-trip verbatim.
let manifest_json = json!({
"schemaVersion": 1,
"migrationId": "m",
- "version": "2.0.0",
"userSalt": "00112233445566778899aabbccddeeff",
"canonicalizedAt": "2026-01-01T00:00:00.000Z",
"tables": { "Items": [] },
@@ -580,7 +577,6 @@ fn content_fingerprint_matches_serialized_manifest_roundtrip() {
let manifest = Manifest {
schema_version: 1,
migration_id: "20250101000000_Test".into(),
- version: "2.0.0".into(),
user_salt: "00ff".into(),
canonicalized_at: "2026-01-01T00:00:00.000Z".into(),
shared_folder_id: None,
@@ -588,6 +584,6 @@ fn content_fingerprint_matches_serialized_manifest_roundtrip() {
extra: std::collections::HashMap::new(),
};
let serialized = serde_json::to_string(&manifest).unwrap();
- let reordered = r#"{"tables":{"Items":[]},"userSalt":"00ff","version":"2.0.0","migrationId":"20250101000000_Test","schemaVersion":1,"canonicalizedAt":"1999-12-31T23:59:59.000Z"}"#;
+ let reordered = r#"{"tables":{"Items":[]},"userSalt":"00ff","migrationId":"20250101000000_Test","schemaVersion":1,"canonicalizedAt":"1999-12-31T23:59:59.000Z"}"#;
assert_eq!(compute_content_fingerprint(&serialized), compute_content_fingerprint(reordered));
}
diff --git a/core/rust/src/vault_codec/types.rs b/core/rust/src/vault_codec/types.rs
index b95231bd8..98f3e720d 100644
--- a/core/rust/src/vault_codec/types.rs
+++ b/core/rust/src/vault_codec/types.rs
@@ -36,7 +36,7 @@ pub static BUCKET_TABLES: &[(&str, &str)] = &[
pub static PERSONAL_TABLES: &[&str] = &["EncryptionKeys"];
/// Manifest / metadata schema version. This is the manifest *wire structure* version and is its own
-/// axis, independent of the data-model `version` string (which tracks EF migrations).
+/// axis, independent of the data-model version (which readers derive from the manifest's `migrationId`).
/// It starts at 1 for the first manifest generation; bump only on a breaking structural change
/// (field type changes, removed fields).
pub const SCHEMA_VERSION: u32 = 1;