grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
141 stars 21 forks source link

SceneObjectBase: Call self activation handlers before child data, time range and variable handlers #628

Closed torkelo closed 8 months ago

torkelo commented 8 months ago

I noticed a bug in scenes dashboards with AnnotationDataLayer not working with data source variables, resulting in error AnnotationsDataLayer.js:95 AnnotationsDataLayer error {message: 'Datasource ${ds} was not found'}

I tracked it down to an issue with scene $data, $timeRange and $variables being activated before the local (own) level activation handlers. Resulting in data layers on the top dashboard level being activated before the dashboard scene itself (that sets the window.__grafanaSceneContext without this the variable system is not working (because scopedVars with sceneObject was not passed in AnnotationsDataLayer)

Changes

Release notes

Activation handlers are for a scene object is now called before any direct child activation handlers. Before this release the activation handlers of direction $data, $timeRange, $variables and $behaviors was called before the SceneObjects own activation handlers.

torkelo commented 8 months ago

@dprokop had not pushed it :)

grafanabot commented 8 months ago

:rocket: PR was released in v3.9.0 :rocket: