Closed jhansche closed 5 years ago
thank you for your contribution and sorry for my very late reply. would you please have a look at the failed build and my review? i am happy to integrate your changes afterwards.
awesome @jhansche! going to release it right now :) thanks for your contribution!
Because
getAvailableCommands()
is used as the basis for many other actions, and the payload is so gigantic, plus the fact that it does not change very frequently, it makes sense to keep that response cached.The only way this would become out of sync is if you make changes to the harmony setup (activities and devices).
To improve on this, it might make sense to see if we can detect when the hub needs a sync, and invalidate the cache then. Or we can add a cache expiration time.
For most clients, the cache isn't needed. This is only useful for a client that keeps the connection open for a long time -- like a REST web service that dispatches commands to Harmony.