On the admin agents page, clicking delete on any row opens a confirmation modal that always names the first agent in the list instead of the agent we clicked.
The handler reads the correct UUID from the clicked row and then builds the modal from the wrong object (web/htdocs/js/shield.js:715-717):
} else if (action == 'delete') {
var agent_uuid = $(event.target).extract('agent-uuid');
modal($($.template('agents-delete', { agent: data.agents[0] }))
The DELETE request a few lines down uses agent_uuid, so the correct agent is removed and no data is lost. The defect is confined to the confirmation text. With one agent registered nobody notices. With several, the modal asks the operator to confirm an irreversible action against a name they did not choose, which is where a display bug does real damage.
The fix is to find the clicked agent in data.agents by UUID and pass that to the template.
Introduced in 7391134 (2019-12-17), still present on develop at 21bea2f.
On the admin agents page, clicking
deleteon any row opens a confirmation modal that always names the first agent in the list instead of the agent we clicked.The handler reads the correct UUID from the clicked row and then builds the modal from the wrong object (
web/htdocs/js/shield.js:715-717):The
DELETErequest a few lines down usesagent_uuid, so the correct agent is removed and no data is lost. The defect is confined to the confirmation text. With one agent registered nobody notices. With several, the modal asks the operator to confirm an irreversible action against a name they did not choose, which is where a display bug does real damage.The fix is to find the clicked agent in
data.agentsby UUID and pass that to the template.Introduced in
7391134(2019-12-17), still present ondevelopat21bea2f.