REST API returns empty list

Hi,

I’m building an app that uses the REST API to switch lights (and later other things) around the house.
According to the documentation (https://developers.home-assistant.io/docs/en/external_api_rest.html) each call of POST /api/services// should return a list of states that have changed while the service was being executed.

The problem is, that it always returns an empty list, even though the light is actually switched. For example, using curl:
$ curl -X POST -H “Content-Type: application/json” -H “X-HA-Access: password” -d ‘{“entity_id”: “light.arduino_mqtt_led_strip”}’ http://x.x.x.x:8123/api/services/light/turn_on
[]

So it seems that the state is not immediately updated.

I also notice this in my app. For example, I change the brightness through the REST API. Once that has returned OK, I request the state from the REST API. Then the state still contains the old brightness, even though the actual brightness of the lamp has changed already.

How can I force the state to update immediately? Or how should I correctly handle this delay?

Have you found the reason or a solution?