-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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): Remove insight reuse on dashboard and insights #21471
Conversation
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Size Change: -259 B (0%) Total Size: 1.04 MB ℹ️ View Unchanged
|
@thmsobrmlr Asking you since @Twixes is ooo. I started to think about dashboard insight loading from scratch. But when accepting that we might just load things fresh from the backend, I found that I can quick fix these issues after all, by removing specific logic that reuses insights. Do you think this works as a short term solution (while I still check if we might cache some insights)? If you don't want to dig into it, it can also wait for Michael. |
I don't have a definitive answer here, but imagine that cached results are quite important for performance. I think something causes insights to load more often then they should when visiting a dashboard, but there are other instance where we still take the cached result. |
📸 UI snapshots have been updated4 snapshot changes in total. 0 added, 4 modified, 0 deleted:
Triggered by this commit. |
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.
I fixed one more edge case that's been reported and added a test for that. Looking good, just pending a couple extra questions!
@@ -629,7 +629,7 @@ describe('insightLogic', () => { | |||
}), | |||
}) | |||
|
|||
it('loads from the dashboardLogic when in dashboard context', async () => { | |||
it.skip('loads from the dashboardLogic when in dashboard context', async () => { |
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.
If these tests are no longer relevant, we should just remove them. It's improbable that we're ever going to re-enable them
@@ -885,7 +861,9 @@ export const dashboardLogic = kea<dashboardLogicType>([ | |||
let refreshesFinished = 0 | |||
let totalResponseBytes = 0 | |||
|
|||
const hardRefreshWithoutCache = ['refresh', 'load_missing'].includes(action) | |||
const hardRefreshWithoutCache = ['refresh', 'load_missing', 'refresh_insights_on_filters_updated'].includes( |
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.
Can we walk me through why refresh_insights_on_filters_updated
is added?
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.
That was because upon changing filters, a request to /insight is made with refresh=false which might return null
as results. Maybe that's different with your other changes now? But yeah let's check tomorrow.
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.
Are all the changes in results here expected?
- "Pageview count" table is no longer time series
- The retention tile no longer shows the date range
- The stickiness tile now shows "No matching events"
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Any idea why one Cypress test now fails? |
We rather load fresh to be save
Fixes remaining unwanted propagation of dashboard filter changes to other dashboards.
I first made this test on master, making sure it fails. Passes on this branch!
31526a6
to
16e9855
Compare
Found why the UI snapshots were different: mocks reused the same |
It was all green earlier.. and locally it fails on a different thing for me, which is not helpful 🤔 |
614068b should fix it. |
This PR fixes (or tries to) #19788 by the way. |
Problem
Another try for #20371 and #20508
How to reproduce:
Changes
insightLogic
anddataNodeLogic
should load stuffonMount
as we already have insights from the main dashboard callDoes this work well for both Cloud and self-hosted?
it doesn't have an impact
How did you test this code?