-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Pause refresh when page is hidden #177693
Pause refresh when page is hidden #177693
Conversation
/ci |
Pinging @elastic/kibana-presentation (Team:Presentation) |
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
Pinging @elastic/appex-sharedux (Team:SharedUX) |
Nice work @Dosant can we also track impact of this in our cloud telemetry after release? Ideally we would see a reduction in proxy logs or something like that. |
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.
Hmm, I'm noticing in Discover (not in Lens) we still seem to get refreshes even when the page is not visible. I've set the refresh interval to 5s and when I switch tabs I'm still getting refreshes every 30s or so.
After putting in some log statements it looks like these refreshes for some reason are not initiated by this code (I'm not getting any events from tickWhenVisible$
), so I think we are still good to move forward with this change... But we will want to do some additional investigation on the Discover side as to why these search requests are still being fired.
Anyway, changes LGTM!
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.
Noticed the same thing as @lukasolson, but it is a great improvement for Lens and Dashboard so approving! Hopefully we'll fix the discover case too 😊
@timductive, I doubt we will be able to see the impact. I am not sure how we can only filter in the excessive traffic caused by auto-refresh while in the background to measure its impact |
💚 Build Succeeded
Metrics [docs]Module Count
Page load bundle
History
To update your PR or re-run it, just comment with: |
@lukasolson, we with @mbondyra found the possible reason for the refetches in the background: Looks like there are coming from this snippet kibana/src/plugins/data/public/search/session/session_service.ts Lines 304 to 334 in a3edafa
Btw, the same should happen on a dashboard with an async search panel (e.g lens) So these refreshes are expected and we won't get rid of them without disabling search sessions |
Summary
close #1878
Pauses auto-refresh when a page is not visible.
I tested and didn't notice any issues, but looking for more testing help
Release Notes
Auto-refresh pauses when the page is not visible.