Fix auto refresh not working after page reload#26088
Conversation
|
Pinging @elastic/kibana-app |
💔 Build Failed |
|
Jenkins, test this - test timed out |
💔 Build Failed |
💚 Build Succeeded |
markov00
left a comment
There was a problem hiding this comment.
Code LGTM. Tested on chrome OSX, this correctly fix the issue
lukeelmers
left a comment
There was a problem hiding this comment.
code LGTM. tested and verified on osx chrome, safari, firefox
* Fix auto refresh after page reload * Fix timefilter initial state
* Fix auto refresh after page reload * Fix timefilter initial state
|
@LeeDr - Do you object to me marking this a blocker and backporting to 6.5? Technically it will cause invalid data to display - if the user has auto refresh of 5 seconds and If you do not object, @timroes has a PR ready to be merged here: https://kibana-ci.elastic.co/job/elastic+kibana+pull-request/1572/ |
|
Being tagged 6.5.2, does it mean 6.5.4 should contain the fix? Because 6.5.4 there is still affected by the bug. |
|
Hi @cowst, yeah this was released in the 6.5.2 release from our side. I am not sure if AWS does specific path picking on patch releases. Could you please download the following two files:
Those should be the JavaScript bundles for your Kibana instance (no private information should be in that). If you could upload them here, I can check if those contain this above fix. Cheers, |
|
I think I see the changes in commons bundle. |
Summary
Fixes #25987
Auto refresh happened to work only by some timing coincident. The
addSetupWorkin timefilter has to be run after the courier service was constructed (and could register its listener for that). That's in 6.5 no longer the case. I can't pinpoint what PR actually broke this. Since it's some timing issue it could potentially have been anything around routing work, some Angular removal or similar.We now properly also set the
searchPolltimeout (which triggers the whole refresh process), when courier starts up after that setup work, i.e. always initially get the refresh interval and set it to searchPoll and not only if we see a change event.Timefilter issue
After fixing that the test failure revealed another issue, that I am fixing with this PR. Currently the timefilter to work properly requires some setup work, that happens during
uiRoutes.addSetupWork, which not necessarily run in all plugins (also see #19110). In some cases you don't want to run it, since you are not planning on using the globalState at all.In those cases, we would read out the
timepicker:refreshIntervalDefaultsconfig which defaults to{ value: 0, pause: false }and just use this. This default config will cause courier to hang, since it now schedules another request for each0msdelay, so we're kind of stuck in an endless loop blocking every execution slot with a new request. If the route setup work runs, this would never happen, since we are callingsetRefreshIntervalwith (if nothing else is that) this value. This method actually makes sure to setpausetotrueifvalueis <= 0.I modified the timefilter slightly so that it always (no matter if route setup work is used or not) calls this method, and just make sure that the update event isn't emitted if there has been no previous refresh interval set.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
[ ] This was checked for breaking API changes and was labeled appropriately