On the Prüfobjekt detail page the scan history (Prüfläufe) already refreshed itself every 5 s while a run was running (#423). But everything above it was loaded once: offene Befunde, the SBOM card (Komponenten, bekannte Schwachstellen), the CRA status bar and the detected facts. After a scan completed they kept their old values (often empty for a first scan) until the page was reloaded by hand.
I did not find a defect in the run-list poll itself (fetch_target_scan_runs is a POST server fn, so no browser caching; same use_future pattern as the Prüfobjekte list). If on stage the run badge itself stays at "läuft", that is a separate issue; please say so.
What changed
ScanRunList takes an optional on_finished handler, called once when a run it saw running has finished (completed, failed or interrupted). Covers scans started on the page and scans started elsewhere (webhook, schedule) while the page is open.
The target page passes a handler that reloads the CRA/SBOM status, the open findings and the target (detected facts). No additional polling: the existing run-list poll is the only timer.
The transition detection is now a pure function run_transitions with a unit test.
A poll no longer re-arms the "expect a just-started run" flag for a scan that was already expected, so the list stops polling as soon as the run finishes (before it kept polling up to a minute longer).
Tests
New components::scan_runs::tests::a_run_seen_running_counts_as_finished_once; cargo test -p compliance-dashboard --features server --no-default-features --lib components::scan_runs (4 passed).
cargo fmt --all --check, clippy -D warnings for compliance-dashboard with server and with web.
Not verified in a browser locally.
Stage re-test
Open a Prüfobjekt and click "Prüfung starten"; stay on the page.
Watch Prüfläufe: the run shows as running with its steps, then switches to abgeschlossen without a reload.
At that moment the cards update by themselves: offene Befunde (count and list), SBOM Komponenten / bekannte Schwachstellen and the CRA bar.
Open the Netzwerk tab of the browser dev tools after the run finished: the scan-run requests stop within ~5 s.
## What was wrong
On the Prüfobjekt detail page the scan history (Prüfläufe) already refreshed itself every 5 s while a run was running (#423). But everything above it was loaded once: offene Befunde, the SBOM card (Komponenten, bekannte Schwachstellen), the CRA status bar and the detected facts. After a scan completed they kept their old values (often empty for a first scan) until the page was reloaded by hand.
I did not find a defect in the run-list poll itself (`fetch_target_scan_runs` is a POST server fn, so no browser caching; same `use_future` pattern as the Prüfobjekte list). If on stage the run badge itself stays at "läuft", that is a separate issue; please say so.
## What changed
- `ScanRunList` takes an optional `on_finished` handler, called once when a run it saw running has finished (completed, failed or interrupted). Covers scans started on the page and scans started elsewhere (webhook, schedule) while the page is open.
- The target page passes a handler that reloads the CRA/SBOM status, the open findings and the target (detected facts). No additional polling: the existing run-list poll is the only timer.
- The transition detection is now a pure function `run_transitions` with a unit test.
- A poll no longer re-arms the "expect a just-started run" flag for a scan that was already expected, so the list stops polling as soon as the run finishes (before it kept polling up to a minute longer).
## Tests
- New `components::scan_runs::tests::a_run_seen_running_counts_as_finished_once`; `cargo test -p compliance-dashboard --features server --no-default-features --lib components::scan_runs` (4 passed).
- `cargo fmt --all --check`, clippy `-D warnings` for compliance-dashboard with `server` and with `web`.
- Not verified in a browser locally.
## Stage re-test
1. Open a Prüfobjekt and click "Prüfung starten"; stay on the page.
2. Watch Prüfläufe: the run shows as running with its steps, then switches to abgeschlossen without a reload.
3. At that moment the cards update by themselves: offene Befunde (count and list), SBOM Komponenten / bekannte Schwachstellen and the CRA bar.
4. Open the Netzwerk tab of the browser dev tools after the run finished: the scan-run requests stop within ~5 s.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
The scan history on the target page already polled while a run was
running, but the cards above it (offene Befunde, SBOM components and known
vulnerabilities, CRA status, detected facts) were loaded once and stayed
at their old values until a manual reload.
ScanRunList now reports a run it saw running that has finished
(on_finished), and the target page reloads those resources then. The
transition is a pure function with a unit test. A poll no longer
re-expects an already expected started scan, so the list stops polling
right after the run finishes instead of up to a minute later.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What was wrong
On the Prüfobjekt detail page the scan history (Prüfläufe) already refreshed itself every 5 s while a run was running (#423). But everything above it was loaded once: offene Befunde, the SBOM card (Komponenten, bekannte Schwachstellen), the CRA status bar and the detected facts. After a scan completed they kept their old values (often empty for a first scan) until the page was reloaded by hand.
I did not find a defect in the run-list poll itself (
fetch_target_scan_runsis a POST server fn, so no browser caching; sameuse_futurepattern as the Prüfobjekte list). If on stage the run badge itself stays at "läuft", that is a separate issue; please say so.What changed
ScanRunListtakes an optionalon_finishedhandler, called once when a run it saw running has finished (completed, failed or interrupted). Covers scans started on the page and scans started elsewhere (webhook, schedule) while the page is open.run_transitionswith a unit test.Tests
components::scan_runs::tests::a_run_seen_running_counts_as_finished_once;cargo test -p compliance-dashboard --features server --no-default-features --lib components::scan_runs(4 passed).cargo fmt --all --check, clippy-D warningsfor compliance-dashboard withserverand withweb.Stage re-test
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p