GladysAssistant / Gladys

A privacy-first, open-source home assistant
https://gladysassistant.com
Apache License 2.0
2.67k stars 282 forks source link

Slowdown in UX display when editing dashboards #2116

Open Terdious opened 1 month ago

Terdious commented 1 month ago

Describe the bug No bug - Just improvement: When we start to have many boxes on a dashboard view, when opening the edition, all the boxes types Chart, Devices, Room Devices, etc. will retrieve the list of available devices. This can cause a slowdown in the display of the boxes unnecessarily.

Expected behavior https://community.gladysassistant.com/t/question-composant-front-menu-edition/9078/4 As seen in the forum conversation with @Pierre-Gilles :

We could set up a Promise cache system to prevent 2 requests from leaving at the same time.

Ex: 2 widgets call the same API. The first widget sends the request and the second just waits for the result of the same request.

This avoids having 2 calls in parallel for the same thing, but it also does not create a cache problem because we only cache the execution (not the result)"