@@ -251,10 +251,23 @@ final class AppState {
251251 @MainActor
252252 func refreshStreams() async {
253253 guard let client else { return }
254+ // Capture the connection this fetch belongs to. A disconnect during the
255+ // await would otherwise let the (now-stale) result overwrite the cleanup
256+ // disconnect() just performed (streams = [], client = nil, etc.), leaving
257+ // the disconnected UI showing the old server's streams and re-enabling
258+ // stream-scoped tabs. Mirrors the connID guard used in performConnect,
259+ // AlertsView.loadAlerts, UsersView.loadUsers, StreamDetailView.loadData,
260+ // and ServerInfoView.loadInfo.
261+ let connID = activeConnection?.id
254262 isLoadingStreams = true
255263 streamLoadError = nil
256264 do {
257− streams = try await client.listStreams()
265+ let loaded = try await client.listStreams()
266+ // Drop results if the active connection changed while awaiting. Still
267+ // clear isLoadingStreams: this task set the spinner, so leaving it true
268+ // wedges the indicator and disables Refresh.
269+ guard connID == activeConnection?.id else { isLoadingStreams = false; return }
270+ streams = loaded
258271 // Drop a selection that no longer exists server-side (e.g. the stream
259272 // was deleted from another client); otherwise the detail tabs keep
260273 // querying a missing stream and surface 404s.
@@ -262,6 +275,7 @@ final class AppState {
262275 selectedStream = nil
263276 }
264277 } catch {
278+ guard connID == activeConnection?.id else { isLoadingStreams = false; return }
265279 let message = ParseableError.userFriendlyMessage(for: error)
266280 streamLoadError = message
267281 self.errorMessage = "Failed to load streams: \(message)"
@@ -356,8 +370,15 @@ final class AppState {
356370 @MainActor
357371 func refreshFilters() async {
358372 guard let client else { return }
373+ // Capture the connection this fetch belongs to. A disconnect during the
374+ // await would otherwise let the (now-stale) result overwrite the cleanup
375+ // disconnect() performed, resurrecting the old server's filters in the
376+ // disconnected sidebar. Same guard pattern as refreshStreams.
377+ let connID = activeConnection?.id
359378 isLoadingFilters = true
360− filters = (try? await client.listFilters()) ?? []
379+ let loaded = (try? await client.listFilters()) ?? []
380+ guard connID == activeConnection?.id else { isLoadingFilters = false; return }
381+ filters = loaded
361382 isLoadingFilters = false
362383 }
363384