Skip to content

Commit 67f08c4

Browse files
committed
Fix Swift compilation errors for CI build
- Remove trailing comma in MainEditorContentView.swift function call - Fix error handling in ImportService.swift by naming caught errors - Add @mainactor annotations to DataGridView.swift methods accessing main actor-isolated properties - Fix UUID double optional issue in TableProApp.swift - Add @mainactor to saveAllTabStates() in AppDelegate.swift These fixes resolve Swift 6 concurrency warnings and compilation errors.
1 parent 6170146 commit 67f08c4

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

TablePro/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
9191
}
9292

9393
/// Save tab state for all active sessions
94+
@MainActor
9495
private func saveAllTabStates() {
9596
for (connectionId, session) in DatabaseManager.shared.activeSessions {
9697
if session.tabs.isEmpty {

TablePro/Core/Services/ImportService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ final class ImportService: ObservableObject {
211211
if config.wrapInTransaction {
212212
do {
213213
_ = try await driver.execute(query: rollbackStatement(for: connection.type))
214-
} catch {
214+
} catch let rollbackError {
215215
// Rollback failed - database may be in inconsistent state
216216
// This is a critical error that MUST be reported to the user
217217
throw ImportError.rollbackFailed(rollbackError.localizedDescription)
@@ -225,7 +225,7 @@ final class ImportService: ObservableObject {
225225
for stmt in fkEnableStmts {
226226
do {
227227
_ = try await driver.execute(query: stmt)
228-
} catch {
228+
} catch let fkError {
229229
// FK re-enable failed - warn user but don't override original error
230230
// Store this as a warning that should be shown alongside the original error
231231
let message = fkError.localizedDescription

TablePro/TableProApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct TableProApp: App {
117117

118118
// Connection Form Window - opens when creating/editing a connection
119119
WindowGroup("Connection", id: "connection-form", for: UUID?.self) { $connectionId in
120-
ConnectionFormView(connectionId: connectionId)
120+
ConnectionFormView(connectionId: connectionId ?? nil)
121121
}
122122
.windowStyle(.hiddenTitleBar)
123123
.windowResizability(.contentSize)

TablePro/Views/Main/Child/MainEditorContentView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ struct MainEditorContentView: View {
297297
onLastPage: onLastPage,
298298
onLimitChange: onLimitChange,
299299
onOffsetChange: onOffsetChange,
300-
onPaginationGo: onPaginationGo,
301-
)
300+
onPaginationGo: onPaginationGo
301+
)
302302
}
303303

304304
private func showStructureBinding(for tab: QueryTab) -> Binding<Bool> {

TablePro/Views/Results/DataGridView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
287287

288288
// MARK: - Row Visual State Cache
289289

290+
@MainActor
290291
func rebuildVisualStateCache() {
291292
rowVisualStateCache.removeAll(keepingCapacity: true)
292293
guard changeManager.hasChanges else { return }
@@ -561,6 +562,7 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
561562

562563
// MARK: - Row Actions
563564

565+
@MainActor
564566
func undoDeleteRow(at index: Int) {
565567
changeManager.undoRowDeletion(rowIndex: index)
566568
tableView?.reloadData(
@@ -572,6 +574,7 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
572574
onAddRow?()
573575
}
574576

577+
@MainActor
575578
func undoInsertRow(at index: Int) {
576579
onUndoInsert?(index)
577580
changeManager.undoRowInsertion(rowIndex: index)
@@ -602,6 +605,7 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
602605
setCellValueAtColumn(value, at: rowIndex, columnIndex: columnIndex)
603606
}
604607

608+
@MainActor
605609
func setCellValueAtColumn(_ value: String?, at rowIndex: Int, columnIndex: Int) {
606610
guard let tableView = tableView else { return }
607611
guard columnIndex >= 0 && columnIndex < rowProvider.columns.count else { return }

0 commit comments

Comments
 (0)