Merge branch 'review/wp5' into review/integration
This commit is contained in:
@@ -275,7 +275,7 @@ Per-leaf alarm rendering (leaf nodes are individual conditions for native alarms
|
||||
- Monitor and manage centrally-delivered notifications. The Notification Outbox dispatches every notification store-and-forwarded from sites and logs each one to the central `Notifications` table.
|
||||
- **KPI tiles** at the top of the page: queue depth (`Pending` + `Retrying`), stuck count, parked count, delivered in the last interval, and oldest pending age. The KPIs are central-computed on demand from the `Notifications` table.
|
||||
- A **queryable notification list** filterable by status, type, source site, notification list, and time range, with a **stuck-only toggle** and keyword search on subject. Each row shows the notification's status, retry count, last error, and key timestamps.
|
||||
- **Retry** and **Discard** actions are available on parked notifications: Retry returns the notification to `Pending` and resets `RetryCount` / `NextAttemptAt`; Discard moves it to `Discarded`. The row is retained either way so the table stays a complete audit record.
|
||||
- **Retry** and **Discard** actions are available on parked notifications: Retry returns the notification to `Pending` and resets `RetryCount` / `NextAttemptAt`; Discard moves it to `Discarded`. The row is retained either way so the table stays a complete audit record. The action re-checks site scope at click time: a system-wide user may act on any row, including one whose source site no longer resolves (deleted or renamed — such rows stay listed); a site-scoped user may act only on rows of a permitted site, and not on an unresolvable one (code review 2026-12-02 UI-11).
|
||||
- Each row exposes a **"View audit history"** action that opens the Audit Log page pre-filtered to `CorrelationId = NotificationId`, surfacing every operational audit event recorded for that notification.
|
||||
- **Stuck rows are visually badged** — a notification is stuck if it is `Pending` or `Retrying` and older than the configurable stuck-age threshold. Stuck detection is display-only; there is no automated escalation or alerting.
|
||||
- All queries are served from the central `Notifications` table — no remote per-site queries are needed, unlike the Parked Message Management page.
|
||||
@@ -293,7 +293,7 @@ Per-leaf alarm rendering (leaf nodes are individual conditions for native alarms
|
||||
### Site Calls (Deployment Role)
|
||||
- Monitor cached calls store-and-forwarded from sites — `ExternalSystem.CachedCall()` and `Database.CachedWrite()` operations. Scoped to the `ExternalCall` and `DatabaseWrite` kinds only; notifications keep their separate Notification Outbox page and are not merged here.
|
||||
- A **queryable cached-call list** filterable by site, kind, status, and time range. Each row shows the call's timestamp, site, kind, target summary, status badge, retry count, and last error.
|
||||
- **Retry** and **Discard** actions are available on `Parked` rows only — `Failed` rows are not actionable, since a permanent failure would simply fail again and its error was already returned synchronously to the calling script. The actions issue central→site commands to the owning site; if the site is offline the UI surfaces a "site unreachable" message.
|
||||
- **Retry** and **Discard** actions are available on `Parked` rows only — `Failed` rows are not actionable, since a permanent failure would simply fail again and its error was already returned synchronously to the calling script. The actions issue central→site commands to the owning site; if the site is offline the UI surfaces a "site unreachable" message. Site scope is re-checked at click time exactly as on the Notification Outbox page: a system-wide user may act on a row whose source site no longer resolves, a site-scoped user may not (UI-11).
|
||||
- Each row exposes a **"View audit history"** action that opens the Audit Log page pre-filtered to `CorrelationId = TrackedOperationId`, showing every operational audit event recorded for that cached call.
|
||||
- Data is served from the central Site Call Audit component's `SiteCalls` table. The page is **read-mostly** — an eventually-consistent mirror of site state; the site remains the source of truth.
|
||||
- **Site scope is applied in the query (code review 2026-12-02 UI-7):** a site-scoped user's permitted site identifiers ride `SiteCallQueryRequest.SourceSitesFilter`, so keyset paging runs over in-scope rows and Next is gated on the server page size. Before, the query was unscoped and the client dropped other sites' rows after paging, so any page with an out-of-scope row was "short" and disabled Next.
|
||||
@@ -365,12 +365,20 @@ Per-leaf alarm rendering (leaf nodes are individual conditions for native alarms
|
||||
|
||||
### Configuration mutations and live circuit authority (2026-09-09)
|
||||
|
||||
Page configuration handlers use `ConfigurationCommandService` and the guarded management command boundary. Database changes and their scrubbed audit entries commit in one transaction, including generated entity IDs. Existing instance service operations execute through the same transaction seam and retain their domain validation and audit ownership. Circuit read tracking is cleared after a separate transaction scope changes configuration.
|
||||
Page configuration handlers use `ConfigurationCommandService` and the guarded management command boundary. Database changes and their scrubbed audit entries commit in one transaction, including generated entity IDs. Existing instance service operations execute through the same transaction seam and retain their domain validation and audit ownership. Circuit read tracking is cleared after a separate transaction scope changes configuration (a no-op since the circuit context stopped tracking — see below).
|
||||
|
||||
Cookie circuits retain their initial principal without retaining `HttpContext`; authoritative reads re-map stored directory groups against current grants. Mutation handlers recheck role and persisted target site immediately before dispatch. Passive session pings do not count as user activity. Trusted browser input posts an antiforgery-protected activity signal; the server activity tracker also makes it visible to the existing circuit.
|
||||
|
||||
The explicit server-configured development auto-login mode preserves its synthetic all-role principal. It uses the Cookies scheme but has no LDAP group claims; it must not enter directory re-mapping. This exception follows validated `AuthDisableLoginOptions`, never a caller-supplied claim.
|
||||
|
||||
### Circuit DbContext lifetime (code review 2026-12-02, UI-1/2/3/8)
|
||||
|
||||
In Blazor Server one DI scope — and so one scoped `ScadaBridgeDbContext` — lives for the whole circuit. That context now reads with a **no-tracking default**: `CircuitDbContextTrackingHandler` (a `CircuitHandler`, resolved when the circuit host is built, before any component) sets `ChangeTracker.QueryTrackingBehavior = NoTracking` on the circuit scope's context only. Every reload therefore sees the database as it is, including changes made in another scope — a data connection moved through the management actor, an area renamed by another user, a template script edited by the CLI or a Transport import. Contexts in every other scope (management-actor commands, the configuration command transaction, HTTP request scopes, hosted services, singleton actors) keep EF's tracking default.
|
||||
|
||||
No page mutates configuration on the circuit's context. Writes go through `ConfigurationCommandService` (its own transaction scope), the `ManagementActor`, or `ScopedServiceExtensions.InNewScopeAsync`, which resolves the load-modify-save service (`TemplateService`, `TemplateFolderService`, `SharedScriptService`, `DeploymentService`, `ArtifactDeploymentService`, `IBundleImporter.ApplyAsync`) from a fresh scope with an empty tracking context and disposes it when the action ends. A source-scan test (`CircuitDbContextTrackingTests`) fails the build if a page calls a mutating method on a circuit-injected instance of one of those services. Adding-only writes on the circuit context (an audit row, a bundle-unlock attempt) are unaffected by the tracking default.
|
||||
|
||||
Long or concurrent page work also runs on its own scope, so it can neither collide with another query on the circuit context ("A second operation was started on this context instance") nor die with the circuit: each Deployments-page load flight, the Sites page's **Deploy Artifacts** (per site and to all sites, whose record, audit rows and revision stamp are written after the site fan-out), and Topology's **Diff**, **Enable**, **Disable** and **Delete** (alongside the existing Deploy / Deploy all / staleness checks).
|
||||
|
||||
### Isolated Test Run workers
|
||||
|
||||
Test Run executes in a disposable `CentralUI.SandboxWorker` process. A process-wide admission gate permits at most four workers. Queueing, compilation, execution and gateway calls consume the requested deadline (1–10 seconds); cancellation kills the process tree and capacity is released only after confirmed exit. Console capture retains at most 32,000 characters with an explicit truncation marker; return JSON is limited to 32,000 bytes. Private IPC frames are limited to 1 MiB and stderr is drained without accumulation. Each worker has a 512 MiB managed-heap ceiling. The worker is a resource/lifetime boundary; the semantic script trust policy still gates compilation.
|
||||
|
||||
Reference in New Issue
Block a user