Code review 2026-12-02 WP5: Central UI DbContext lifetime #156

Closed
opened 2026-12-02 16:06:55 -05:00 by dohertj2 · 1 comment
Owner

From the 2026-12-02 full code review (commit 28b6651a).

  • Findings: docs/plans/2026-12-02-full-code-review.md
  • Plan: docs/plans/2026-12-02-full-code-review-remediation.md → WP5
Task Findings Change Verify
5.1 UI-1 Register the circuit's context with UseQueryTrackingBehavior(NoTracking). Services that mutate opt in with AsTracking(). Audit each mutating service: write paths that relied on implicit tracking must attach/update explicitly. Full CentralUI + ConfigurationDatabase suites. Playwright: Move to Site, Topology rename refresh, template script reload after a CLI edit.
5.2 UI-2, UI-3, UI-8 Run long or concurrent page actions in their own DI scope (as Topology's Deploy all already does), and serialize the page loads. bUnit tests.
5.3 UI-4 Check a disposed flag / CTS after every await before creating timers or subscriptions. bUnit tests.
5.4 UI-11 Retry/Discard on a row whose site was deleted: allow it for unscoped callers. Test.
From the 2026-12-02 full code review (commit 28b6651a). - Findings: `docs/plans/2026-12-02-full-code-review.md` - Plan: `docs/plans/2026-12-02-full-code-review-remediation.md` → WP5 | Task | Findings | Change | Verify | |---|---|---|---| | 5.1 | UI-1 | Register the circuit's context with `UseQueryTrackingBehavior(NoTracking)`. Services that mutate opt in with `AsTracking()`. Audit each mutating service: write paths that relied on implicit tracking must attach/update explicitly. | Full CentralUI + ConfigurationDatabase suites. Playwright: Move to Site, Topology rename refresh, template script reload after a CLI edit. | | 5.2 | UI-2, UI-3, UI-8 | Run long or concurrent page actions in their own DI scope (as Topology's Deploy all already does), and serialize the page loads. | bUnit tests. | | 5.3 | UI-4 | Check a disposed flag / CTS after every await before creating timers or subscriptions. | bUnit tests. | | 5.4 | UI-11 | Retry/Discard on a row whose site was deleted: allow it for unscoped callers. | Test. |
dohertj2 added the type:review-findingpriority:p1 labels 2026-12-02 16:06:55 -05:00
Author
Owner

Fixed on main (pushed, 922021c4). Plan: docs/plans/2026-12-02-full-code-review-remediation.md (see its Outcome section).

All 4 tasks done.

  • 5.1: the circuit's DbContext defaults to NoTracking, set by a handler on the circuit scope only. Every Central UI write path was inventoried and moved to its own DI scope. Management and actor contexts keep tracking.

Rig: Topology (More actions → Expand → load instances), Deployments and Sites were probed by hand with no console errors. The Playwright suite, with its stale 2026-11-13 selectors fixed (5acb16ca), now fails only the 11 role-negative tests that always fail on this rig.

Commits:

  • 2421a4e4 fix(centralui): system-wide users can Retry/Discard rows from a deleted site (UI-11, WP5 task 5.4)
  • 7addd846 fix(centralui): no timers/subscriptions created after a mid-load dispose (UI-4, WP5 task 5.3)
  • 2969ee44 fix(centralui): no-tracking default on the circuit DbContext; mutations on their own scope (UI-1, WP5 task 5.1)
  • 2e194f4e fix(centralui): run long/concurrent page actions in their own DI scope (UI-2, UI-3, UI-8, WP5 task 5.2)

Deploying to QA and DEV is tracked in #160. Closing.

Fixed on `main` (pushed, `922021c4`). Plan: `docs/plans/2026-12-02-full-code-review-remediation.md` (see its Outcome section). All 4 tasks done. - **5.1:** the circuit's DbContext defaults to NoTracking, set by a handler on the circuit scope only. Every Central UI write path was inventoried and moved to its own DI scope. Management and actor contexts keep tracking. **Rig:** Topology (More actions → Expand → load instances), Deployments and Sites were probed by hand with no console errors. The Playwright suite, with its stale 2026-11-13 selectors fixed (5acb16ca), now fails only the 11 role-negative tests that always fail on this rig. **Commits:** - 2421a4e4 fix(centralui): system-wide users can Retry/Discard rows from a deleted site (UI-11, WP5 task 5.4) - 7addd846 fix(centralui): no timers/subscriptions created after a mid-load dispose (UI-4, WP5 task 5.3) - 2969ee44 fix(centralui): no-tracking default on the circuit DbContext; mutations on their own scope (UI-1, WP5 task 5.1) - 2e194f4e fix(centralui): run long/concurrent page actions in their own DI scope (UI-2, UI-3, UI-8, WP5 task 5.2) Deploying to QA and DEV is tracked in #160. Closing.
Sign in to join this conversation.