aws-solutions / iot-device-simulator

The IoT Device Simulator solution is a Graphical User Interface (GUI) based engine designed to enable customers to get started quickly assessing AWS IoT services without an existing pool of devices. The IoT Device Simulator helps effortlessly create and simulate thousands of connected devices that are defined by the customer.
https://aws.amazon.com/solutions/implementations/iot-device-simulator/
Apache License 2.0
158 stars 83 forks source link

The Delete buttons for Devices do not seem to correspond with what is being deleted #29

Closed ryanfeiock closed 1 year ago

ryanfeiock commented 1 year ago

Describe the bug On the Device Types page, I have 4 devices setup: CNCMachine1 LaserCutter WaterCutter smart-home

I want to delete CNCMachine1, and when I click the Delete button on the line with CNCMachine1, it brings up the Confirm delete dialog box, and in the box it prompts with this message: Are you sure you want to delete smart-home

If I click on Confirm the site does indeed delete smart-home and not CNCMachine1 as intended.

To Reproduce I am not sure if I did anything to get it into this state as I just built it out a few hours ago, and have been adding devices and simulations today to test out my IoT Core/SiteWise setup. But from my current state, this is how I recreate it:

Expected behavior I would expect that clicking on the Delete button next to TestDeleteDevice would prompt for deleting TestDeleteDevice and upon confirming the delete would indeed delete the TestDeleteDevice device.

Please complete the following information about the solution:

Screenshots

Additional context

dwil618 commented 1 year ago

I also experienced this bug when I was using the simulator. I dug a little deeper and found what I think to be the cause: Due to the way the react code (incorrectly) manages the popup state, when you click the delete button, it opens a confirmation dialog for every item in the list, so the last one is always on top.

One way to work around this is to inspect the element using the browser dev tools, and delete the dialogs individually, until the one you want is on top, and can be clicked

jangidms commented 1 year ago

Hi @ryanfeiock Thank you for reporting this behavior. We are planning to include fix for this issue in next release of the solution. Please continue to monitor the repo for updates.