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

avoid 'app not found' flickering while awaiting for mount #56483

Merged

Conversation

pgayvallet
Copy link
Contributor

Summary

Fix #56409

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:fix Feature:New Platform v7.7.0 labels Jan 31, 2020
@pgayvallet pgayvallet requested a review from a team as a code owner January 31, 2020 13:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

Comment on lines +57 to +64
if (!mounter || appStatus !== AppStatus.accessible) {
return setAppNotFound(true);
}
setAppNotFound(false);

if (mounter.unmountBeforeMounting) {
unmount();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main fix was to setAppNotFound(false); before awaiting for mounter.mount.
I also extracted all the non-mount related code outside of mount function to execute all we can in a synchronous way (effects does not support async, so we are not effectively waiting for mount to resolve)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is starting to feel like a class component would be simpler to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. As discussed on slack, I think we should migrate back to class component next time we need to perform changing on this component. This may be when we'll want to show a proper loading message while awaiting the mounter.mount result.

Comment on lines +57 to +64
if (!mounter || appStatus !== AppStatus.accessible) {
return setAppNotFound(true);
}
setAppNotFound(false);

if (mounter.unmountBeforeMounting) {
unmount();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is starting to feel like a class component would be simpler to understand.

@joshdover
Copy link
Contributor

Tested locally, it worked.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform release_note:fix Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Platform Applications flashes "Application Not Found" UI when loading
4 participants