git.iko.soy/parseable-macos
on master help sign in
Fix 2 bugs: LiveTail same-column include filters silently empty, stale SQL error position applied to edited text
commite792c42a9845437ba37f6eb357ce706dfd354fe0 authoriko <mail@iko.soy> dateWed 24 Jun 2026, 05:08 (3 months ago) parentc21859a
2 files changed+19−2
ParseableViewer/ViewModels/LiveTailViewModel.swift+9 ParseableViewer/ViewModels/QueryViewModel.swift+10−2
ParseableViewer/ViewModels/LiveTailViewModel.swift+9
@@ -164,6 +164,15 @@ final class LiveTailViewModel {
164164 // include↔exclude stacks both and the AND'd filters match zero rows, so the
165165 // tail silently empties.
166166 columnFilters.removeAll { $0.column == column && $0.value == value }
167+ if !exclude {
168+ // Include filters are AND-combined in rebuildFilteredEntries, but a column
169+ // can only equal one value, so two includes on the same column with
170+ // different values (e.g. level = info then level = error) can never both
171+ // match and the tail would silently empty. A new include therefore
172+ // replaces any prior include on that column. (Excludes legitimately stack:
173+ // col ≠ a AND col ≠ b is meaningful, so they are left untouched here.)
174+ columnFilters.removeAll { $0.column == column && !$0.exclude }
175+ }
167176 columnFilters.append(ColumnFilter(column: column, value: value, exclude: exclude))
168177 rebuildFilteredEntries()
169178 }
ParseableViewer/ViewModels/QueryViewModel.swift+10−2
@@ -487,9 +487,17 @@ final class QueryViewModel {
487487 errorMessage = ParseableError.userFriendlyMessage(for: error)
488488 if let serverError = error as? ParseableError,
489489 case .serverError(_, let msg) = serverError,
490− let pos = SQLErrorPosition.parse(from: msg) {
490+ let pos = SQLErrorPosition.parse(from: msg),
491+ sqlQuery == sql {
492+ // The server's line/column is relative to the *submitted* SQL.
493+ // Only map it back into the editor when the editor still holds
494+ // that same text — if the user edited the query while it was in
495+ // flight, the position no longer corresponds to what's displayed
496+ // and would underline an unrelated span. (`sqlQuery`'s didSet
497+ // already cleared errorRange on that edit, so leaving it nil here
498+ // keeps the editor unmarked.)
491499 errorRange = SQLTokenizer.errorHighlightRange(
492− line: pos.line, column: pos.column, in: sqlQuery
500+ line: pos.line, column: pos.column, in: sql
493501 )
494502 }
495503 results = []