Skip to content

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

Update vault version and constants (#2159)

Leendert de Borstaad728826e96
diff --git a/core/vault/src/__tests__/VersionCompatibility.test.ts b/core/vault/src/__tests__/VersionCompatibility.test.ts
index 50cfd8392..31d780773 100644
--- a/core/vault/src/__tests__/VersionCompatibility.test.ts
+++ b/core/vault/src/__tests__/VersionCompatibility.test.ts
@@ -166,4 +166,26 @@ describe('VersionCompatibility', () => {
});
});
});
+
+ describe('frozen migration chain', () => {
+ it('should end at vault version 2.0.0 (revision 13) and never gain new entries', () => {
+ /*
+ * The legacy sqlite blob migration chain is frozen.
+ */
+ const latest = getLatestClientVersion();
+ expect(latest.version).toBe('2.0.0');
+ expect(latest.revision).toBe(13);
+ });
+
+ it('should accept newer full-schema EF stamps (e.g. 2.1.0) via the same-major fallback', () => {
+ /*
+ * Materialized databases carry EF history rows beyond 2.0.0 (e.g. 2.1.0-AddCodecOverflows).
+ * Those are unknown to the frozen chain on purpose and must resolve as compatible.
+ */
+ const result = checkVersionCompatibility('2.1.0');
+ expect(result.isCompatible).toBe(true);
+ expect(result.isKnownVersion).toBe(false);
+ expect(result.isMajorVersionDifference).toBe(false);
+ });
+ });
});
diff --git a/core/vault/src/sql/SqlConstants.ts b/core/vault/src/sql/SqlConstants.ts
index 2b331d09a..ba644439a 100644
--- a/core/vault/src/sql/SqlConstants.ts
+++ b/core/vault/src/sql/SqlConstants.ts
@@ -80,16 +80,25 @@ CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");
CREATE INDEX "IX_Passwords_CredentialId" ON "Passwords" ("CredentialId");
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240708094944_1.0.0-InitialMigration', '9.0.4');
+VALUES ('20240708094944_1.0.0-InitialMigration', '10.0.10');
+COMMIT;
+
+BEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240708224522_1.0.1-EmptyTestMigration', '9.0.4');
+VALUES ('20240708224522_1.0.1-EmptyTestMigration', '10.0.10');
+COMMIT;
+
+BEGIN TRANSACTION;
ALTER TABLE "Aliases" RENAME COLUMN "EmailPrefix" TO "Email";
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '9.0.4');
+VALUES ('20240711204207_1.0.2-ChangeEmailColumn', '10.0.10');
+
+COMMIT;
+BEGIN TRANSACTION;
CREATE TABLE "EncryptionKeys" (
"Id" TEXT NOT NULL CONSTRAINT "PK_EncryptionKeys" PRIMARY KEY,
"PublicKey" TEXT NOT NULL,
@@ -100,8 +109,11 @@ CREATE TABLE "EncryptionKeys" (
);
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240729105618_1.1.0-AddPkiTables', '9.0.4');
+VALUES ('20240729105618_1.1.0-AddPkiTables', '10.0.10');
+
+COMMIT;
+BEGIN TRANSACTION;
CREATE TABLE "Settings" (
"Key" TEXT NOT NULL CONSTRAINT "PK_Settings" PRIMARY KEY,
"Value" TEXT NULL,
@@ -110,8 +122,11 @@ CREATE TABLE "Settings" (
);
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240805073413_1.2.0-AddSettingsTable', '9.0.4');
+VALUES ('20240805073413_1.2.0-AddSettingsTable', '10.0.10');
+
+COMMIT;
+BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Aliases" (
"Id" TEXT NOT NULL CONSTRAINT "PK_Aliases" PRIMARY KEY,
"BirthDate" TEXT NOT NULL,
@@ -142,7 +157,7 @@ COMMIT;
PRAGMA foreign_keys = 1;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '9.0.4');
+VALUES ('20240805122422_1.3.0-UpdateIdentityStructure', '10.0.10');
BEGIN TRANSACTION;
CREATE TABLE "ef_temp_Credentials" (
@@ -182,7 +197,7 @@ CREATE INDEX "IX_Credentials_ServiceId" ON "Credentials" ("ServiceId");
COMMIT;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '9.0.4');
+VALUES ('20240812141727_1.3.1-MakeUsernameOptional', '10.0.10');
BEGIN TRANSACTION;
ALTER TABLE "Settings" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;
@@ -200,8 +215,11 @@ ALTER TABLE "Attachment" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;
ALTER TABLE "Aliases" ADD "IsDeleted" INTEGER NOT NULL DEFAULT 0;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240916105320_1.4.0-AddSyncSupport', '9.0.4');
+VALUES ('20240916105320_1.4.0-AddSyncSupport', '10.0.10');
+COMMIT;
+
+BEGIN TRANSACTION;
ALTER TABLE "Attachment" RENAME TO "Attachments";
CREATE TABLE "ef_temp_Attachments" (
@@ -238,7 +256,7 @@ CREATE INDEX "IX_Attachments_CredentialId" ON "Attachments" ("CredentialId");
COMMIT;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '9.0.4');
+VALUES ('20240917191243_1.4.1-RenameAttachmentsPlural', '10.0.10');
BEGIN TRANSACTION;
CREATE TABLE "TotpCodes" (
@@ -255,8 +273,11 @@ CREATE TABLE "TotpCodes" (
CREATE INDEX "IX_TotpCodes_CredentialId" ON "TotpCodes" ("CredentialId");
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20250310131554_1.5.0-AddTotpCodes', '9.0.4');
+VALUES ('20250310131554_1.5.0-AddTotpCodes', '10.0.10');
+
+COMMIT;
+BEGIN TRANSACTION;
PRAGMA foreign_keys = OFF;
@@ -675,7 +696,7 @@ CREATE INDEX "IX_Passkeys_CredentialId" ON "Passkeys" ("CredentialId");
CREATE INDEX "IX_Passkeys_RpId" ON "Passkeys" ("RpId");
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20251014122838_1.6.0-AddPasskeys', '9.0.4');
+VALUES ('20251014122838_1.6.0-AddPasskeys', '10.0.10');
COMMIT;
@@ -1274,11 +1295,22 @@ CREATE INDEX "IX_TotpCodes_ItemId" ON "TotpCodes" ("ItemId");
COMMIT;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20251213111207_1.7.0-FieldBasedDataModelUpdate', '9.0.4');
+VALUES ('20251213111207_1.7.0-FieldBasedDataModelUpdate', '10.0.10');
BEGIN TRANSACTION;
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
-VALUES ('20260130221620_2.0.0-MajorVersionBump', '9.0.4');
+VALUES ('20260130221620_2.0.0-MajorVersionBump', '10.0.10');
+
+COMMIT;
+
+BEGIN TRANSACTION;
+CREATE TABLE "CodecOverflows" (
+ "Id" TEXT NOT NULL CONSTRAINT "PK_CodecOverflows" PRIMARY KEY,
+ "Data" TEXT NOT NULL
+);
+
+INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
+VALUES ('20260721081936_2.1.0-AddCodecOverflows', '10.0.10');
COMMIT;
`;
diff --git a/core/vault/src/sql/VaultVersions.ts b/core/vault/src/sql/VaultVersions.ts
index ad7800388..067d88ada 100644
--- a/core/vault/src/sql/VaultVersions.ts
+++ b/core/vault/src/sql/VaultVersions.ts
@@ -6,9 +6,15 @@
import { VaultVersion } from "../types/VaultVersion";
/**
- * All vault migrations/versions in chronological order. When adding a new migration, make sure to
- * update the "releaseVersion" field to the correct AliasVault release version that introduced this
- * migration.
+ * All vault migrations/versions in chronological order.
+ *
+ * NOTE: this legacy migration chain is FROZEN — do not add new entries. It exists solely to
+ * upgrade pre-2.0.0 blob-era vaults (via the user-facing upgrade prompt) up to vault version
+ * 2.0.0, the first schema compatible with the manifest-v1 storage model. From 2.0.0 onwards the
+ * local SQLite is re-materialized from COMPLETE_SCHEMA_SQL on every vault pull, so schema changes
+ * ship through the full schema only: no individual migration scripts and no version entries here.
+ *
+ * TODO: delete this once all active users have migrated to 2.0.0+
*/
export const VAULT_VERSIONS: VaultVersion[] = [
{