diff --git a/src/backend/ssh/tunnel.ts b/src/backend/ssh/tunnel.ts index b49606e6..fea461c6 100644 --- a/src/backend/ssh/tunnel.ts +++ b/src/backend/ssh/tunnel.ts @@ -217,7 +217,9 @@ function cleanupTunnelResources( if (verification?.timeout) clearTimeout(verification.timeout); try { verification?.conn.end(); - } catch (e) {} + } catch { + // Ignore errors + } tunnelVerifications.delete(tunnelName); } @@ -282,7 +284,9 @@ function handleDisconnect( const verification = tunnelVerifications.get(tunnelName); if (verification?.timeout) clearTimeout(verification.timeout); verification?.conn.end(); - } catch (e) {} + } catch { + // Ignore errors + } tunnelVerifications.delete(tunnelName); } @@ -518,9 +522,7 @@ async function connectSSHTunnel( keyType: credential.key_type || credential.keyType, authMethod: credential.auth_type || credential.authType, }; - } else { } - } else { } } catch (error) { tunnelLogger.warn("Failed to resolve source credentials from database", { @@ -631,7 +633,9 @@ async function connectSSHTunnel( try { conn.end(); - } catch (e) {} + } catch { + // Ignore errors + } activeTunnels.delete(tunnelName); @@ -771,7 +775,9 @@ async function connectSSHTunnel( const verification = tunnelVerifications.get(tunnelName); if (verification?.timeout) clearTimeout(verification.timeout); verification?.conn.end(); - } catch (e) {} + } catch { + // Ignore errors + } tunnelVerifications.delete(tunnelName); } @@ -1186,7 +1192,7 @@ async function killRemoteTunnelByMarker( } else { } - stream.on("close", (code) => { + stream.on("close", () => { commandIndex++; executeNextKillCommand(); }); diff --git a/src/backend/utils/database-migration.ts b/src/backend/utils/database-migration.ts index ebf3192b..0fba053e 100644 --- a/src/backend/utils/database-migration.ts +++ b/src/backend/utils/database-migration.ts @@ -55,7 +55,6 @@ export class DatabaseMigration { if (hasEncryptedDb && hasUnencryptedDb) { const unencryptedSize = fs.statSync(this.unencryptedDbPath).size; - const encryptedSize = fs.statSync(this.encryptedDbPath).size; if (unencryptedSize === 0) { needsMigration = false; @@ -168,9 +167,6 @@ export class DatabaseMigration { return false; } - let totalOriginalRows = 0; - let totalMemoryRows = 0; - for (const table of originalTables) { const originalCount = originalDb .prepare(`SELECT COUNT(*) as count FROM ${table.name}`) @@ -179,9 +175,6 @@ export class DatabaseMigration { .prepare(`SELECT COUNT(*) as count FROM ${table.name}`) .get() as { count: number }; - totalOriginalRows += originalCount.count; - totalMemoryRows += memoryCount.count; - if (originalCount.count !== memoryCount.count) { databaseLogger.error( "Row count mismatch for table during migration verification", diff --git a/src/backend/utils/lazy-field-encryption.ts b/src/backend/utils/lazy-field-encryption.ts index 06c43d8c..2fd7cce1 100644 --- a/src/backend/utils/lazy-field-encryption.ts +++ b/src/backend/utils/lazy-field-encryption.ts @@ -29,7 +29,7 @@ export class LazyFieldEncryption { return false; } return true; - } catch (jsonError) { + } catch { return true; } } @@ -53,7 +53,7 @@ export class LazyFieldEncryption { fieldName, ); return decrypted; - } catch (error) { + } catch { const legacyFieldName = this.LEGACY_FIELD_NAME_MAP[fieldName]; if (legacyFieldName) { try { @@ -64,7 +64,9 @@ export class LazyFieldEncryption { legacyFieldName, ); return decrypted; - } catch (legacyError) {} + } catch { + // Ignore legacy format errors + } } const sensitiveFields = [ @@ -135,7 +137,7 @@ export class LazyFieldEncryption { wasPlaintext: false, wasLegacyEncryption: false, }; - } catch (error) { + } catch { const legacyFieldName = this.LEGACY_FIELD_NAME_MAP[fieldName]; if (legacyFieldName) { try { @@ -156,7 +158,9 @@ export class LazyFieldEncryption { wasPlaintext: false, wasLegacyEncryption: true, }; - } catch (legacyError) {} + } catch { + // Ignore legacy format errors + } } return { encrypted: fieldValue, @@ -243,7 +247,7 @@ export class LazyFieldEncryption { try { FieldCrypto.decryptField(fieldValue, userKEK, recordId, fieldName); return false; - } catch (error) { + } catch { const legacyFieldName = this.LEGACY_FIELD_NAME_MAP[fieldName]; if (legacyFieldName) { try { @@ -254,7 +258,7 @@ export class LazyFieldEncryption { legacyFieldName, ); return true; - } catch (legacyError) { + } catch { return false; } }