fix(raw): a stale open can no longer feed the picker another device's config

This commit is contained in:
Joseph Doherty
2026-08-05 03:36:04 -04:00
parent c1c21f3ff8
commit 4e3a6e8497
3 changed files with 55 additions and 2 deletions
@@ -20,14 +20,26 @@ internal sealed class FakeRawTreeService : IRawTreeService
public Func<string, (string DriverType, string MergedConfigJson)?> OnLoadMergedProbeConfig { get; set; } =
_ => throw new NotImplementedException();
/// <summary>
/// Optional asynchronous override of <see cref="OnLoadTagForEdit"/>. The sync delegates above
/// complete inline, which cannot express two opens overlapping on one modal instance — set this to
/// gate a load on a <see cref="TaskCompletionSource"/> and interleave the second open.
/// </summary>
public Func<string, Task<RawTagEditDto?>>? OnLoadTagForEditAsync { get; set; }
/// <summary>Optional asynchronous override of <see cref="OnLoadMergedProbeConfig"/>; see <see cref="OnLoadTagForEditAsync"/>.</summary>
public Func<string, Task<(string DriverType, string MergedConfigJson)?>>? OnLoadMergedProbeConfigAsync { get; set; }
/// <inheritdoc/>
public Task<RawTagEditDto?> LoadTagForEditAsync(string tagId, CancellationToken ct = default)
=> Task.FromResult(OnLoadTagForEdit(tagId));
=> OnLoadTagForEditAsync is { } async ? async(tagId) : Task.FromResult(OnLoadTagForEdit(tagId));
/// <inheritdoc/>
public Task<(string DriverType, string MergedConfigJson)?> LoadMergedProbeConfigAsync(
string deviceId, CancellationToken ct = default)
=> Task.FromResult(OnLoadMergedProbeConfig(deviceId));
=> OnLoadMergedProbeConfigAsync is { } async
? async(deviceId)
: Task.FromResult(OnLoadMergedProbeConfig(deviceId));
/// <inheritdoc/>
public Task<IReadOnlyList<RawNode>> LoadRootsAsync(CancellationToken ct = default)