home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.98k stars 2.72k forks source link

Repairs -- Reload/Remove options, randomly sorted #21996

Open Makr91 opened 2 weeks ago

Makr91 commented 2 weeks ago

Checklist

Describe the issue you are experiencing

I had a power outage the other day. The NFS servers came up after Home assistant did, thus when Home Assistant started it checks, it marked all the NFS shares as repairs, and gives the option to "Reload" or "Remove" the mounted storage.

The problem is, I have about 10-12 Mounts, probably more than most, and I quickly run through the repairs once the NFS server is up, however because my muscle memory is faster than my visual reasoning, and since the UI randomly sorts the "Reload" and "Remove" options. I have managed to delete a few of the mounts because of the ordering. Its not a huge deal for most mounts, but I can't recreate a few mounts as afterwords the path was written to by an addon, and thus now has files in it, that I have to manually move over in order to clear the directory and then recreate the mount entry in Home Assistant.

Examples of varying ordering: image image

Describe the behavior you expected

I expect the ordering to be consistent.

Steps to reproduce the issue

  1. Setup a few NFS mounts via Home Assistant UI
  2. Break your NFS share (probably just unplug the NIC)
  3. Wait for the Repair options in Home Assistant to Show

What version of Home Assistant Core has the issue?

core-2024.9.1

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Mozilla Firefox (any), Chrome (any)

Which operating system are you using to run this browser?

Debian 12, Windows 10

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

karwosts commented 1 week ago

So I don't think this is going to end up being a frontend issue, but it might be pretty hard to track down.

Frontend fetches the config flow and the menu_options (repair or remove) are returned in an array from the config flow fetch, and the options I believe are displayed in the order they are returned.

So seems like maybe something in either core or supervisor (not sure which) is listing these options in random order, though I can't guess why. Seems like both components have a hand in this repair flow.

I'll leave this open, but you might want to see if you can get any help in core or supervisor, if someone can look there.

Sounds annoying ☹️

silamon commented 1 week ago

I've seen this in other config flows as well, so it's a core issue.

Makr91 commented 1 week ago

Thanks, I will create an issue in core in a bit.