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

SceneQueryController: Fixes double complete counting #600

Closed torkelo closed 9 months ago

torkelo commented 9 months ago

Fixes a bug in SceneQueryController that resulted in negative __grafanaRunningQueryCount due to double counting completed queries.

This is caused by wrapper calling queryCompleted on first packet with state != LoadingState.Done (needed for some data sources who's observable never really completes), and we called queryCompleted on observable complete.

Added a simple check in queryCompleted that the query is part of the running set, now we only try to remove it once and decrement __grafanaRunningQueryCount once

📦 Published PR as canary version: 3.3.1--canary.600.7900942701.0
:sparkles: Test out this PR locally via: ```bash npm install @grafana/scenes@3.3.1--canary.600.7900942701.0 # or yarn add @grafana/scenes@3.3.1--canary.600.7900942701.0 ```
grafanabot commented 9 months ago

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