fix(adminui): Request-rebirth cannot be armed on a Sparkplug plant that has not birthed since the browse window opened #514
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The browse tree is birth-driven: it is built from the births observed since the browse session opened. On a
quiet plant — every edge node already birthed long ago and is publishing only NDATA/DDATA — the tree comes up
empty, and Request rebirth… is scoped from a tree selection, so the one action that would populate the tree
cannot be armed. Chicken-and-egg.
The session side is already capable.
RequestRebirthAsyncaccepts a bare{group}/{edgeNode}scope — itdoes not require a selected device or metric. What is missing is a way for the operator to express that scope
when there is nothing in the tree to select.
Fix sketch. Let the operator type/choose an edge-node scope (or offer a broadcast to the configured
groupId) when the tree is empty, rather than gating the button on a tree selection. A group-wide rebirth isnoisy on a large plant, so prefer an explicit edge-node entry over a blanket broadcast, or warn before it.
Related: #510 (the button's enablement is also captured once, at browse-open).
Acceptance. Against a simulator that birthed before the browse window opened, an operator can request a
rebirth and see the tree populate — without restarting the simulator or the driver.
Fixed in master
2a7d1167.Confirmed the issue's read:
MqttBrowseSession.ResolveRebirthTargetsalready handles a bare{group}/{edgeNode}— its own comment calls that case "the prime rebirth target". So this was purelya missing affordance, and the fix adds an edge-node entry field shown whenever no tree scope is
selected. The driver's configured
groupIdpre-seeds it, so only the edge node has to be typed.Edge-node scope only, deliberately. A group scope is rejected: the session resolves one by
enumerating observed edge nodes, of which an empty tree has none — so it could not help the very case
this exists for, and on a populated plant it would fan one click across the whole group.
The rule is extracted to
SparkplugRebirthScoperather than left inline in the Razor, because this repohas no bUnit and logic stranded in markup is untestable. It is advisory: the session re-resolves and
refuses an unusable scope before publishing anything, so being the looser of the two checks is safe
while being the stricter one would block a scope the session accepts.