Skip to content
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

fix(ui): fixed yield bug that was caused by race condition #17208

Merged
merged 2 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
1. [17049](https://github.com/influxdata/influxdb/pull/17049): Fixed bug that was preventing the interval status on the dashboard header from refreshing on selections
1. [17161](https://github.com/influxdata/influxdb/pull/17161): Update table custom decimal feature for tables to update table onFocus
1. [17168](https://github.com/influxdata/influxdb/pull/17168): Fixed UI bug that was setting Telegraf config buttons off-center and was resizing config selections when filtering through the data
1. [17208](https://github.com/influxdata/influxdb/pull/17208): Fixed UI bug that was setting causing dashboard cells to error when the a v.bucket was being used and was being configured for the first time

## v2.0.0-beta.5 [2020-02-27]

Expand Down
7 changes: 5 additions & 2 deletions ui/src/timeMachine/actions/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ export const executeQueries = (dashboardID?: string) => async (
dispatch(setQueryResults(RemoteDataState.Loading, [], null))

await dispatch(refreshTimeMachineVariableValues(dashboardID))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this updates the state. So when we we were using state beforehand, the state we had referenced was changed here, but those changes weren't reflected on the state variable


const variableAssignments = getVariableAssignments(state)
// keeping getState() here ensures that the state we are working with
// is the most current one. By having this set to state, we were creating a race
// condition that was causing the following bug:
// https://github.com/influxdata/idpe/issues/6240
const variableAssignments = getVariableAssignments(getState())
const orgID = getOrg(state).id

const startTime = Date.now()
Expand Down