fix(admin-ui): isolate UNS callers and recover confirmed-write refreshes

This commit is contained in:
Joseph Doherty
2026-11-14 01:14:15 -05:00
parent 575f81abe4
commit aa919ceef2
44 changed files with 1937 additions and 87 deletions
@@ -76,6 +76,22 @@ public sealed class TreeRecoveryTests:BunitContext
cut.FindAll("button").Single(b=>b.TextContent=="Clear filter").Click();
cut.Find("input").GetAttribute("value").ShouldBeNullOrEmpty();cut.Markup.ShouldContain("Press 1");reads.Calls.ShouldBe(1);reads.OtherCalls.ShouldBe(0);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ViewReadLifetime_DisposalIsIdempotent(bool raw)
{
if(raw)
{
Services.AddSingleton(DispatchProxy.Create<IRawTreeService,TreeReads>());var cut=Render<RawPage>();
await cut.InvokeAsync(()=>{cut.Instance.Dispose();cut.Instance.Dispose();});
}
else
{
Services.AddSingleton(DispatchProxy.Create<IUnsTreeService,TreeReads>());var cut=Render<UnsPage>();
await cut.InvokeAsync(()=>{cut.Instance.Dispose();cut.Instance.Dispose();});
}
}
public class TreeReads:DispatchProxy
{
public bool Fail=true;public IReadOnlyList<UnsNode> UnsRoots=[];public int Calls,OtherCalls;public CancellationToken Token;public TaskCompletionSource<IReadOnlyList<RawNode>>? Hold;