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

[Dashboard] [Controls] Skip First Reload #142868

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

ThomThomson
Copy link
Contributor

@ThomThomson ThomThomson commented Oct 6, 2022

Summary

Fixes an issue where Discover Saved Searches sometimes were aborted on the first load of a dashboard.

This was caused by the control group forcing a lastReloadRequestTime updated on dashboards on their first load, even though the control group selections which were saved into the dashboard had already been applied.

This PR fixes this by postponing the dashboard control group sync code until after the control group is finished loading and outputting its initial filters, and by skipping the first, blank filter update that the control group outputs.

How to test

Because the discover issue is difficult to reproduce with the demo data, and locally, the best way to test this would be to place a console log in
src/plugins/dashboard/public/application/lib/dashboard_control_group.ts line 146. and ensure that the dashboard container's lastReloadRequestTime is only updated when expected.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #19 / dashboard drilldowns Dashboard to dashboard drilldown Create & use drilldowns test dashboard to dashboard drilldown with controls use dashboard to dashboard drilldown via onClick action

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
dashboard 419.4KB 419.5KB +129.0B

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

@ThomThomson ThomThomson added Feature:Dashboard Dashboard related features release_note:fix Feature:Input Control Input controls visualization Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Project:Controls backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 6, 2022
@ThomThomson ThomThomson marked this pull request as ready for review October 6, 2022 16:42
@ThomThomson ThomThomson requested a review from a team as a code owner October 6, 2022 16:42
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Code review + tested locally by putting the console.log in the place described and doing the following:

  1. Loaded a dashboard with controls with no selections - lastReloadRequestTime was not updated by the control group
  2. Made a selection for one of the controls - lastReloadRequestTime was* updated
  3. Saved the dashboard after making selection and refreshed the dashboard - lastReloadRequestTime was not updated and the filters from the previous selections were applied as expected
  4. Made another selection, leaving the dashboard in an unsaved state, and refreshed the dashboard - lastReloadRequestTime was not updated and the filters from the unsaved selections were applied as expected

@ThomThomson ThomThomson merged commit 5a17c64 into elastic:main Oct 6, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 6, 2022
* Skip first reload of dashboard controls to ensure only the filters from control group initialization are applied

(cherry picked from commit 5a17c64)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.5

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 7, 2022
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
* Skip first reload of dashboard controls to ensure only the filters from control group initialization are applied
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

kibanamachine added a commit that referenced this pull request Oct 12, 2022
* [Dashboard] [Controls] Skip First Reload (#142868)

* Skip first reload of dashboard controls to ensure only the filters from control group initialization are applied

(cherry picked from commit 5a17c64)

* temporarily skip problematic test suite

Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 13, 2022
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
* Skip first reload of dashboard controls to ensure only the filters from control group initialization are applied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Dashboard Dashboard related features Feature:Input Control Input controls visualization impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort Project:Controls release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants