Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Reassigning the Execute Query, Execute All Statements, and Cancel Query shortcuts now takes effect, and the Query menu shows the new keys (#1357)
- Custom shortcuts now require a modifier key, so a plain key like Space is no longer accepted and then silently ignored (#1357)
- Cancelling a pending connection no longer lets the abandoned attempt overwrite or drop a later successful connection to the same database (#1358)
- Cancelling a pending SSH connection now closes its tunnel instead of leaving the local forward port open (#1369)
- Importing connections from DBeaver now brings over the username (#1355)

## [0.43.1] - 2026-05-20
Expand Down
8 changes: 8 additions & 0 deletions TablePro/Core/Database/DatabaseManager+EnsureConnected.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import Foundation
import os

extension DatabaseManager {
func ensureConnected(_ connection: DatabaseConnection) async throws {
Expand All @@ -16,6 +17,13 @@ extension DatabaseManager {
func cancelEnsureConnected(_ connectionId: UUID) async {
await ensureConnectedDedup.cancel(key: connectionId)
if let session = activeSessions[connectionId], session.driver == nil {
if session.connection.resolvedSSHConfig.enabled {
do {
try await SSHTunnelManager.shared.closeTunnel(connectionId: connectionId)
} catch {
Self.logger.warning("SSH tunnel cleanup failed for \(connectionId): \(error.localizedDescription)")
}
}
removeSessionEntry(for: connectionId)
if currentSessionId == connectionId {
currentSessionId = nil
Expand Down
Loading