Template reads: ResyncInheritedMembersAsync and HandleGetResolvedTemplateMembers still load the whole tracked library #89

Closed
opened 2026-11-09 13:11:21 -05:00 by dohertj2 · 1 comment
Owner

After #66/#86 two template reads still load the whole tracked library: TemplateService.ResyncInheritedMembersAsync and ManagementActor.HandleGetResolvedTemplateMembers (~line 876) both call GetAllTemplatesAsync. Resync can reuse the #86 subtree read (GetTemplateReconcileClosureAsync); resolve-members only needs the parent chain, untracked (#66's analysis closure or a chain-only read). Add equivalence + load tests like #66/#86.

After #66/#86 two template reads still load the whole tracked library: `TemplateService.ResyncInheritedMembersAsync` and `ManagementActor.HandleGetResolvedTemplateMembers` (~line 876) both call `GetAllTemplatesAsync`. Resync can reuse the #86 subtree read (`GetTemplateReconcileClosureAsync`); resolve-members only needs the parent chain, untracked (#66's analysis closure or a chain-only read). Add equivalence + load tests like #66/#86.
dohertj2 added the type:debtpriority:p3 labels 2026-11-09 13:11:21 -05:00
Author
Owner

Fixed on main 6070cc2b: resync loads only the #86 closure (subtree + parent chain), falling back to just the parent chain (new GetTemplateChainAsync) when nothing derives from the template; HandleGetResolvedTemplateMembers loads only the parent chain, untracked (#66's closure can't be reused there — it drops script bodies, which resolved-members returns). Tests: TemplateChainReadTests (every template in the #86 fixture + unknown id; same writes/audit/result with the whole-library load wired to throw; identical resolved members) — 17 fail on old code, 13 without the empty-closure fallback; TemplateChainRepositoryTests (SQLite: 4-deep chain loads 4 of 46 templates, one query per level); ResolvedTemplateMembersReadTests (never calls GetAllTemplatesAsync). Evidence: slnx 0 warnings/0 errors after rebase; TemplateEngine, ManagementService, Transport, Transport.IntegrationTests, ConfigurationDatabase passed; DeploymentManager passed 3/3 re-runs (one earlier run hit the separately-filed DeploySiteAsync flake).

Fixed on main 6070cc2b: resync loads only the #86 closure (subtree + parent chain), falling back to just the parent chain (new GetTemplateChainAsync) when nothing derives from the template; HandleGetResolvedTemplateMembers loads only the parent chain, untracked (#66's closure can't be reused there — it drops script bodies, which resolved-members returns). Tests: TemplateChainReadTests (every template in the #86 fixture + unknown id; same writes/audit/result with the whole-library load wired to throw; identical resolved members) — 17 fail on old code, 13 without the empty-closure fallback; TemplateChainRepositoryTests (SQLite: 4-deep chain loads 4 of 46 templates, one query per level); ResolvedTemplateMembersReadTests (never calls GetAllTemplatesAsync). Evidence: slnx 0 warnings/0 errors after rebase; TemplateEngine, ManagementService, Transport, Transport.IntegrationTests, ConfigurationDatabase passed; DeploymentManager passed 3/3 re-runs (one earlier run hit the separately-filed DeploySiteAsync flake).
Sign in to join this conversation.