Skip to content

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

Cleanup (#2159)

Leendert de Borst7b9d3ebf9319
diff --git a/apps/mobile-app/hooks/useVaultSync.ts b/apps/mobile-app/hooks/useVaultSync.ts
index 4a1bd3b58..fac0d2d0b 100644
--- a/apps/mobile-app/hooks/useVaultSync.ts
+++ b/apps/mobile-app/hooks/useVaultSync.ts
@@ -300,10 +300,9 @@ async function handleSyncError(
await app.logout(messageWithCode);
return false;
- // Network errors - set offline mode, don't logout
+ // Network errors - set offline mode, don't logout.
case AppErrorCode.SERVER_UNAVAILABLE:
case AppErrorCode.NETWORK_ERROR:
- case AppErrorCode.TIMEOUT:
await dbContext.setIsOffline(true);
onOffline?.();
// Return true to continue with local vault
diff --git a/apps/mobile-app/platform/MobilePlatform.ts b/apps/mobile-app/platform/MobilePlatform.ts
index d53473801..332721bcb 100644
--- a/apps/mobile-app/platform/MobilePlatform.ts
+++ b/apps/mobile-app/platform/MobilePlatform.ts
@@ -14,6 +14,7 @@ const TRANSLATION_KEYS: Record<TranslatableMessage, string> = {
[TranslatableMessage.UnnamedSharedVault]: 'items.sharedFolderName',
[TranslatableMessage.ClientOutdated]: 'vault.errors.appOutdated',
[TranslatableMessage.SharedFolderDeleteRefused]: 'items.deleteSharedFolderHint',
+ [TranslatableMessage.VaultUpgradeRequired]: 'vault.errors.vaultOutdated',
};
/*
diff --git a/apps/mobile-app/platform/NativeRustCore.ts b/apps/mobile-app/platform/NativeRustCore.ts
index 8d79c7ce1..216764d72 100644
--- a/apps/mobile-app/platform/NativeRustCore.ts
+++ b/apps/mobile-app/platform/NativeRustCore.ts
@@ -63,8 +63,6 @@ export const nativeRustCore: IRustCore = {
srpDeriveSession: (clientSecret, serverPublic, salt, identity, privateKey) => call('srpDeriveSession', clientSecret, serverPublic, salt, identity, privateKey),
getSyncableTableNames: () => call('getSyncableTableNames'),
- mergeCanonical: (input) => call('mergeCanonicalJson', JSON.stringify(input)),
- pruneVault: (input) => call('pruneVaultJson', JSON.stringify(input)),
getPruneTableQueries: () => call('getPruneTableQueries'),
vaultCodecCanonicalizeFromSqlite: (input) => call('vaultCodecCanonicalizeFromSqlite', JSON.stringify(input)),
diff --git a/apps/mobile-app/utils/types/errors/AppErrorCodes.ts b/apps/mobile-app/utils/types/errors/AppErrorCodes.ts
index 35c82381d..9602ec06b 100644
--- a/apps/mobile-app/utils/types/errors/AppErrorCodes.ts
+++ b/apps/mobile-app/utils/types/errors/AppErrorCodes.ts
@@ -43,6 +43,7 @@ export enum AppErrorCode {
CLIENT_VERSION_NOT_SUPPORTED = 'E-301',
SERVER_VERSION_NOT_SUPPORTED = 'E-302',
VAULT_VERSION_INCOMPATIBLE = 'E-303',
+ SERVER_UPDATE_REQUIRED = 'E-304',
// Vault status errors (E-4xx) - from AppError.kt + VaultSync.kt
VAULT_MERGE_REQUIRED = 'E-401',
@@ -73,6 +74,7 @@ export enum AppErrorCode {
STORAGE_WRITE_FAILED = 'E-602', // Sync engine: a state, database or at-rest vault write failed
DATABASE_INIT_FAILED = 'E-603', // Sync engine: the staging database could not be opened
VAULT_STORE_FAILED = 'E-604', // AppError: failed to store vault
+ MANIFEST_NOT_RECORDED = 'E-605', // AppError: native write attempted before a personal manifest id was recorded
// Merge errors (E-7xx) - from VaultSync.kt
MERGE_FAILED = 'E-701', // AppError: vault merge failed
@@ -223,6 +225,7 @@ export function getErrorTranslationKey(code: AppErrorCode): string {
[AppErrorCode.CLIENT_VERSION_NOT_SUPPORTED]: 'vault.errors.versionNotSupported',
[AppErrorCode.SERVER_VERSION_NOT_SUPPORTED]: 'vault.errors.serverVersionNotSupported',
[AppErrorCode.VAULT_VERSION_INCOMPATIBLE]: 'vault.errors.appOutdated',
+ [AppErrorCode.SERVER_UPDATE_REQUIRED]: 'vault.errors.serverVersionNotSupported',
// Vault status errors
[AppErrorCode.VAULT_MERGE_REQUIRED]: 'common.errors.unknownErrorTryAgain',
diff --git a/core/client/src/platform/TranslatableMessage.ts b/core/client/src/platform/TranslatableMessage.ts
index 53a0ef885..bc28c9584 100644
--- a/core/client/src/platform/TranslatableMessage.ts
+++ b/core/client/src/platform/TranslatableMessage.ts
@@ -12,4 +12,7 @@ export enum TranslatableMessage {
/** A shared vault's anchor folder cannot be deleted from the folder list. */
SharedFolderDeleteRefused = 'shared-folder-delete-refused',
+
+ /** The vault still has to walk the sqlite-blob upgrade chain before the manifest migration can run. */
+ VaultUpgradeRequired = 'vault-upgrade-required',
}