fix(raw): a superseded manual-entry open can no longer feed the pickers another device's config

This commit is contained in:
Joseph Doherty
2026-08-05 03:38:25 -04:00
parent 4e3a6e8497
commit 2c19a50bf9
2 changed files with 44 additions and 0 deletions
@@ -160,6 +160,9 @@
private bool _summaryOk;
private bool _open; // guards re-seeding rows on unrelated re-renders
// Identifies WHICH open a post-await write belongs to; _open alone cannot tell two opens apart.
private int _openGeneration;
// Merged Driver+Device config for each row's address picker — the same blob Test-connect and
// RawBrowseModal dial, resolved once per open; null (→ "{}") when the resolve failed: the picker's
// browse degrades to its graceful error chip.
@@ -175,6 +178,7 @@
}
if (_open) { return; } // same open, re-render → preserve in-progress rows
_open = true;
var generation = ++_openGeneration;
_rows.Clear();
_rows.Add(new RowModel());
_summary = null;
@@ -186,6 +190,10 @@
try
{
var merged = await Svc.LoadMergedProbeConfigAsync(DeviceId);
// A close-reopen onto another device can complete while this resolve is in flight, so a
// superseded open must never install its device's config under the displayed grid.
if (generation != _openGeneration || !Visible) { return; }
if (merged is { } m) { _mergedConfigJson = m.MergedConfigJson; }
}
catch