git.iko.soy/parseable-macos
on master help sign in
Fix 3 bugs: stuck loading spinner on connection/stream-switch races
commitd55225f6bbe3a6034d4d1aec2238d9ce28f8d85d authoriko <mail@iko.soy> dateSun 21 Jun 2026, 14:48 (3 months ago) parent395f7af
3 files changed+11−5
ParseableViewer/Views/AlertsView.swift+4−2 ParseableViewer/Views/ServerInfoView.swift+3−1 ParseableViewer/Views/UsersView.swift+4−2
ParseableViewer/Views/AlertsView.swift+4−2
@@ -85,10 +85,12 @@ struct AlertsView: View {
8585 // The manual Refresh/Retry buttons spawn detached Tasks not tied to
8686 // `.task(id: stream)` cancellation, so a slow refresh for the old stream
8787 // can resolve after a switch. Drop stale results.
88− guard stream == appState.selectedStream else { return }
88+ // Still clear isLoading on the stale path: this task set the spinner,
89+ // so leaving it true wedges the ProgressView and disables Refresh.
90+ guard stream == appState.selectedStream else { isLoading = false; return }
8991 alertConfig = config
9092 } catch {
91− guard stream == appState.selectedStream else { return }
93+ guard stream == appState.selectedStream else { isLoading = false; return }
9294 errorMessage = ParseableError.userFriendlyMessage(for: error)
9395 }
9496
ParseableViewer/Views/ServerInfoView.swift+3−1
@@ -168,7 +168,9 @@ struct ServerInfoView: View {
168168
169169 // Drop results if the active connection changed while awaiting, so a slow
170170 // load for the previous server can't overwrite the current one's state.
171− guard connID == appState.activeConnection?.id else { return }
171+ // Still clear isLoading: this task owns the spinner it set, and leaving it
172+ // true on the stale path wedges the ProgressView and disables Refresh.
173+ guard connID == appState.activeConnection?.id else { isLoading = false; return }
172174 isHealthy = healthy
173175 about = aboutValue
174176 errorMessage = aboutError
ParseableViewer/Views/UsersView.swift+4−2
@@ -95,8 +95,10 @@ struct UsersView: View {
9595 loadError = ParseableError.userFriendlyMessage(for: error)
9696 }
9797
98− // Drop results if the active connection changed while awaiting.
99− guard connID == appState.activeConnection?.id else { return }
98+ // Drop results if the active connection changed while awaiting. Still clear
99+ // isLoading: this task set the spinner, so leaving it true on the stale path
100+ // wedges the ProgressView and disables Refresh.
101+ guard connID == appState.activeConnection?.id else { isLoading = false; return }
100102 if let loaded { users = loaded }
101103 errorMessage = loadError
102104 isLoading = false