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(insights): Fall back to dataNodeLogic results #22196

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,17 @@ export const dataNodeLogic = kea<dataNodeLogicType>([
actions.clearResponse()
}
if (
!(props.cachedResults && props.key.includes('dashboard')) && // Don't load data on dashboard if cached results are available
!(
(props.cachedResults?.['result'] || props.cachedResults?.['results']) &&
props.key.includes('dashboard')
) && // Don't load data on dashboard if cached results are available
((!values.response?.['result'] && !values.response?.['results']) ||
!queryEqual(props.query, oldProps.query)) &&
(!props.cachedResults ||
(isInsightQueryNode(props.query) && !props.cachedResults['result'] && !props.cachedResults['results']))
) {
actions.loadData()
} else if (props.cachedResults) {
} else if (props.cachedResults && !values.response?.['result'] && !values.response?.['results']) {
// Use cached results if available, otherwise this logic will load the data again
actions.setResponse(props.cachedResults)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/dashboard/dashboardLogic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ describe('dashboardLogic', () => {
})
.toFinishAllListeners()
.toMatchValues({
refreshStatus: { 1001: { error: true, timer: expect.anything() } },
refreshStatus: { 1001: { refreshed: true, timer: expect.anything() } },
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/dashboard/dashboardLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
}
cancelled = true
} else {
actions.setRefreshError(insight.short_id)
actions.setRefreshStatus(insight.short_id)
}
}

Expand Down