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

[Lens] Fix auto session-renewal on non-timebased data views #129313

Merged
merged 8 commits into from
Apr 6, 2022

Conversation

flash1293
Copy link
Contributor

Fixes #129028

This PR makes sure the session is not auto-refreshed due to time lag if the current data view isn't bound to the time picker.

Cases that should work:

No time field / no date histogram

  • Configure a data view without a time field
  • Set time range to last 15 mins on dashboard
  • Add Lens panel
  • Set created data view
  • Configure a chart without date histogram
  • Wait for 20s
  • Configure something which isn't triggering a new query (e.g. color of series)
  • No refetch

No time field / date histogram

  • Configure a data view without a time field
  • Set time range to last 15 mins on dashboard
  • Add Lens panel
  • Set created data view
  • Configure a chart with date histogram
  • Wait for 20s
  • Configure something which isn't triggering a new query (e.g. color of series)
  • Lens refetches

No time field / unbound date histogram

  • Configure a data view without a time field
  • Set time range to last 15 mins on dashboard
  • Add Lens panel
  • Set created data view
  • Configure a chart with date histogram and disable the "Bind to global time range" setting
  • Wait for 20s
  • Configure something which isn't triggering a new query (e.g. color of series)
  • No refetch

Time field

  • Configure a data view with a time field
  • Set time range to last 15 mins on dashboard
  • Add Lens panel
  • Set created data view
  • Configure a chart without date histogram
  • Wait for 20s
  • Configure something which isn't triggering a new query (e.g. color of series)
  • Lens refetches

@flash1293 flash1293 added release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens auto-backport Deprecated - use backport:version if exact versions are needed v8.2.0 v8.3.0 labels Apr 4, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.1MB 1.1MB +330.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@flash1293 flash1293 marked this pull request as ready for review April 5, 2022 12:56
@flash1293 flash1293 requested a review from a team as a code owner April 5, 2022 12:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks great and works as expected. Approved.

When checking it though, I noticed that we can set auto refresh in the dashboard and then go to one of the Lens panels that have no time based data view, the Lens editor keeps refreshing. There's no way to turn it off as a time picker is not visible. Do you think it's an issue worth reporting or we are ok with this behavior?

@stratoula
Copy link
Contributor

This bug has been also issued for Discover #102132.
I am not sure but maybe a solution is for these cases to render the autoRefreshOnly component (the one that appears on markdown too).

@flash1293
Copy link
Contributor Author

flash1293 commented Apr 6, 2022

@stratoula That's a separate issue, this one is not about auto-refresh in the sense of "every n seconds", but about the refetching of data on user-initiated change if too much time passed since data was last fetched (2% of the length of the current time range). Still agree about the "autoRefreshOnly" component - this is a valid use case.

@stratoula
Copy link
Contributor

@flash1293 I was referring to Marta's comment. If I get it correctly she refers to the timepicker Refresh every x minutes. Have I misunderstood the comment?

@mbondyra
Copy link
Contributor

mbondyra commented Apr 6, 2022

no no, you're right - I think Joe was referring to the PR, and you to my comment. That's why I shouldn't start discussion about different problem inside the other problem 😅

@flash1293
Copy link
Contributor Author

Ah, sorry!

@stratoula
Copy link
Contributor

Oh sorry, no comment on the PR, it works fine :D

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit that referenced this pull request Apr 6, 2022
kibanamachine added a commit that referenced this pull request Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.2.0 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Time lag session-renewal is triggered even if the current chart is not time bound
6 participants