Skip to content

Lite's Job History shows that it is loading and says when it shows only the newest rows (#4478) - #4488

Merged
erikdarlingdata merged 2 commits into
devfrom
fix/4478-lite-job-history
Sep 27, 2026
Merged

erikdarlingdata merged 2 commits into
devfrom
fix/4478-lite-job-history

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Refs #4478.

Why

The Viewer's Job History tab (#4481) got a loading message while its read is in flight and a "showing the newest 2,000" label when the unfiltered read hit its row cap, so an empty grid mid-load doesn't read as "no jobs ran," and a capped read doesn't look like a complete history. Lite's Job History tab has the same 2,000-row cap and the same read-in-flight window, but neither cue.

What changes

  • Lite/Controls/JobHistoryTab.xaml: adds a LoadingMessage text block, styled like the tab's existing empty-state message, collapsed by default.
  • Lite/Controls/JobHistoryTab.xaml.cs:
    • a named RowCap = 2000 constant, replacing the literal 2000 passed to GetJobHistoryAsync;
    • LoadJobsAsync shows LoadingMessage before the read starts and collapses it in a finally, so it clears on every exit path (success, the caught exception, and the load-guard's superseded/early return);
    • the run-count label runs the unfiltered read's count (all.Count), not the filtered display count, through the shared PerformanceMonitor.Common.JobHistoryCap.Label (already referenced by Lite for AgTopology), appending (showing the newest 2,000) only when the read actually hit the cap.

Test plan

  • New pin, Darling/Darling.Tests/LiteJobHistoryLoadingCapTests.cs: a source-scan fact (the same idiom as ViewerPerfmonShapingParityTests), since Lite's UserControl is WPF and cannot be instantiated off Windows. It asserts:
    • JobHistoryTab.xaml.cs calls JobHistoryCap.Label(, and its LoadJobsAsync sets LoadingMessage.Visibility = Visibility.Visible before the read and Visibility.Collapsed inside a finally;
    • JobHistoryTab.xaml declares x:Name="LoadingMessage".
    • RED on dev: both facts fail — dev's Lite tab has neither the call nor the element.
    • Mutation: dropping the JobHistoryCap.Label( call (temporarily replacing it with "") reproduces the RED on the call-site fact; reverted.
  • Ran LiteJobHistoryLoadingCapTests + JobHistoryCapLabelTests (the label text itself, already pinned by The Viewer counts Availability Groups by identity, shows Job History loading, and says "queries" (#4475, #4478) #4481, not duplicated here) + DocCommentHygieneTests: Total 82, 0 failed, on macOS via the in-process xunit v3 runner.
  • Built Darling.Tests.csproj and Lite.Tests.csproj Release with -p:EnableWindowsTargeting=true: 0 warnings, 0 errors on both. Lite's WPF UI (the XAML rendering, the loading/label wiring in a live grid) is exercised only in the Windows CI build; the pin here is source-level and cannot see a rendering bug that keeps the same source text.

CHANGELOG

SECTION: Fixed
ENTRY:

Mirrors the Viewer's fix in #4481: LoadJobsAsync shows a loading message
while the read runs (collapsed in a finally on every exit path), and the
run count label states "showing the newest 2,000" through the shared
PerformanceMonitor.Common.JobHistoryCap only when the unfiltered read
actually hit the cap.

Adds a macOS-runnable source-scan pin in Darling.Tests, since Lite's UI
is WPF and cannot be instantiated outside Windows CI.
… current (#4478)

LoadJobsAsync's finally used to collapse the loading indicator unconditionally, so an older, still-in-flight load could hide the newer load's indicator when the two overlapped. The collapse (on both the success and caught-exception exit paths) now runs only when the load's own generation has not been superseded, mirroring the file's existing supersession check. The Viewer's JobHistoryTab.xaml.cs carried the same unguarded collapse with no load-generation guard at all; it now claims and checks its own generation the same way its DatabaseStateOverridesWindow twin does.

Also extends the census's site table to cover the Viewer's JobHistoryTab.LoadJobsAsync, and updates the existing Lite Job History pin to assert the guarded-collapse shape instead of a bare finally block (the bare-finally shape was exactly the bug).
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 27, 2026 19:00
@erikdarlingdata
erikdarlingdata merged commit 1566a84 into dev Sep 27, 2026
15 of 16 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/4478-lite-job-history branch September 27, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant