-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clone SceneQueryRunner together with _results #681
Conversation
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
@@ -421,6 +421,8 @@ export class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implemen | |||
clone['_layerAnnotations'] = this._layerAnnotations.map((frame) => ({ ...frame })); | |||
} | |||
|
|||
clone['_results'].next({ origin: this, data: this.state.data }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a unit test would be nice
This should also fix grafana/grafana#84573 right? UPDATE: ah of course not, it's completely different thing :) |
🚀 PR was released in |
Fixes grafana/grafana#84575
Fixes an issue where the DashboardDS would not get the correct data from the source panels
SceneQueryRunner._results
because the source panel_results
buffer would be empty. This affected the dashboard DS in various scenarios but was observed consistently when creating a new dashboard.In a new dashboard, if you would create a new panel, it's
_results
buffer in the query runner would be empty. As soon as you saved the dashboard and refreshed the page the buffer would populate and thus the DashboardDS would also work.The problem was in
SceneQueryRunner
cloning where we now emit the data in the clone so it can be picked up by the DashboardDS.📦 Published PR as canary version:
4.5.4--canary.681.8570869587.0
✨ Test out this PR locally via:
npm install @grafana/scenes@4.5.4--canary.681.8570869587.0 # or yarn add @grafana/scenes@4.5.4--canary.681.8570869587.0