-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Restart session if fixed now becomes outdated #88575
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresChrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors·ts.Actions and Triggers app Connectors should test a connector and display a successful resultStandard Out
Stack Trace
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
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.
Tested and LGTM!
Because of #84405 and the usage of sessions in Lens, right now the value for "now" in date math used in the time range in the Lens editor is only reset if the query/time range is changed or the refresh button is used. Changing the visualization/datasource state will keep the previous "now" value - if the editor is left open a while, this can lead to a large difference between the configured time range and the shown data.
This PR fixes this by checking on each state change how much the "now" value of the session diverges from the actual current time - if this lag is larger than 2% of the total configured time range, the session will be reset.
Related changes
useTimeRange
lastKnownDoc
updates on everyonChange
call no matter whether the doc actually changedonChange
effect in the frame passing up the current state to the app because nothing within it depends on the date range (I believe this is a leftover)