Skip to content

Commit 6d7692c

Browse files
committed
fix: address review findings for SQLite file open and queue handling
1 parent 5b30cc6 commit 6d7692c

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

TablePro/AppDelegate+ConnectionHandler.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extension AppDelegate {
9090
return
9191
}
9292

93-
let filePath = url.path
93+
let filePath = url.path(percentEncoded: false)
9494
let connectionName = url.deletingPathExtension().lastPathComponent
9595

9696
for (sessionId, session) in DatabaseManager.shared.activeSessions {
@@ -129,7 +129,12 @@ extension AppDelegate {
129129
// MARK: - Unified Queue
130130

131131
func scheduleQueuedURLProcessing() {
132+
guard !isProcessingQueuedURLs else { return }
133+
isProcessingQueuedURLs = true
134+
132135
Task { @MainActor [weak self] in
136+
defer { self?.isProcessingQueuedURLs = false }
137+
133138
var ready = false
134139
for _ in 0..<25 {
135140
if WindowOpener.shared.openWindow != nil { ready = true; break }
@@ -143,6 +148,8 @@ extension AppDelegate {
143148
self.queuedURLEntries.removeAll()
144149
return
145150
}
151+
152+
self.suppressWelcomeWindow()
146153
let entries = self.queuedURLEntries
147154
self.queuedURLEntries.removeAll()
148155
for entry in entries {
@@ -151,6 +158,7 @@ extension AppDelegate {
151158
case .sqliteFile(let url): self.handleSQLiteFile(url)
152159
}
153160
}
161+
self.scheduleWelcomeWindowSuppression()
154162
}
155163
}
156164

TablePro/AppDelegate.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
4141
/// Counter for outstanding suppressions; welcome window is suppressed while > 0
4242
var fileOpenSuppressionCount = 0
4343

44+
/// True while a queued URL polling task is active — prevents duplicate pollers
45+
var isProcessingQueuedURLs = false
46+
4447
// MARK: - NSApplicationDelegate
4548

4649
func application(_ application: NSApplication, open urls: [URL]) {

TablePro/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
<dict>
105105
<key>public.filename-extension</key>
106106
<array>
107+
<string>sqlite</string>
108+
<string>sqlite3</string>
107109
<string>db3</string>
108110
<string>s3db</string>
109111
<string>sl3</string>

0 commit comments

Comments
 (0)