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][Inspector] Close the inspector on Lens unmount #114317

Merged
merged 5 commits into from
Oct 14, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Oct 7, 2021

Summary

Fixes for Lens only #45928

This PR anticipate the creation of the inspector wrapper, in order to have a reference in the mounter to call on exit.

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

@dej611
Copy link
Contributor Author

dej611 commented Oct 11, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Oct 13, 2021

@elasticmachine merge upstream

@dej611 dej611 marked this pull request as ready for review October 13, 2021 08:39
@dej611 dej611 requested a review from a team as a code owner October 13, 2021 08:39
@dej611 dej611 added auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.16.0 v8.0.0 labels Oct 13, 2021
@elasticmachine
Copy link
Contributor

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

@mbondyra
Copy link
Contributor

@elasticmachine merge upstream

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.

the behavior is as expected and the code LGTM :ok

Just FYI, I changed the description so it doesn't close the issue, but checking the visualize app and discover looks like Lens is the only one to fix so maybe it's ok with closing the issue when merging this PR? Let me know :)

@@ -101,7 +101,7 @@ export function App({
const [isSaveModalVisible, setIsSaveModalVisible] = useState(false);
const [lastKnownDoc, setLastKnownDoc] = useState<Document | undefined>(undefined);

const lensInspector = getLensInspectorService(inspector);
const lensInspector = inspector;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: what if instead we do in line 65

const {
    data,
    chrome,
    uiSettings,
    inspector: lensInspector,
    application,
    notifications,
    savedObjectsTagging,
    getOriginatingAppName,
    spaces,
    http,
    // Temporarily required until the 'by value' paradigm is default.
    dashboardFeatureFlag,
  } = lensAppServices;

@dej611
Copy link
Contributor Author

dej611 commented Oct 14, 2021

Just FYI, I changed the description so it doesn't close the issue, but checking the visualize app and discover looks like Lens is the only one to fix so maybe it's ok with closing the issue when merging this PR? Let me know :)

You're right. Maybe I can extends this fix to Visualize here and leave the Discover one on the issue - updating the labels with the discover one only. What do you think?

@mbondyra
Copy link
Contributor

Sure, that sounds great! I'll check it again when it's ready. But I checked it briefly and couldn't make it break on Visualize so maybe it's ok 🤷🏼‍♀️ Please re-check!

@flash1293
Copy link
Contributor

I think this is just an issue in Lens today, I just re-used the issue.

@kibanamachine
Copy link
Contributor

💚 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.0MB 1.0MB +133.0B

History

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

@dej611
Copy link
Contributor Author

dej611 commented Oct 14, 2021

I cannot reproduce the issue in Visualize. I'll assign the linked issue to Discover once this gets merged then.

@dej611 dej611 merged commit d0e19e4 into elastic:master Oct 14, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2021
* 🐛 First attempt to close the inspector automatically on app unmount

* 👌 Integrate feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 14, 2021
)

* 🐛 First attempt to close the inspector automatically on app unmount

* 👌 Integrate feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
artem-shelkovnikov pushed a commit to artem-shelkovnikov/kibana that referenced this pull request Oct 20, 2021
* 🐛 First attempt to close the inspector automatically on app unmount

* 👌 Integrate feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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 v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants