Skip to content

[Guided onboarding] More API fixes#144729

Merged
yuliacech merged 3 commits intoelastic:mainfrom
yuliacech:guided_onboarding/8.6_api_fixes_intialization
Nov 8, 2022
Merged

[Guided onboarding] More API fixes#144729
yuliacech merged 3 commits intoelastic:mainfrom
yuliacech:guided_onboarding/8.6_api_fixes_intialization

Conversation

@yuliacech
Copy link
Contributor

This PR updates the logic of the API service to prevent spamming the endpoint with too many requests, especially when there is no active guide. The solution is to introduce a variable for initialized state because otherwise we can't differentiate between a guide state that has not been fetched yet and a guide state that represents a new deployment with no active guides yet.

@yuliacech yuliacech added release_note:skip Skip the PR/issue when compiling release notes Team:Journey/Onboarding Platform Journey Onboarding team v8.6.0 labels Nov 7, 2022
@yuliacech yuliacech marked this pull request as ready for review November 7, 2022 17:29
@yuliacech yuliacech requested a review from a team as a code owner November 7, 2022 17:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-onboarding (Team:Journey/Onboarding)

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! Left one question in the code, but otherwise LGTM. Tested locally.

);
const currentState = this.guideState$.value;
if (!currentState && !this.isGuideStateLoading && !this.isGuideStateInitialized) {
this.isGuideStateLoading = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why this is needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll add a comment to the code

@yuliacech yuliacech enabled auto-merge (squash) November 8, 2022 08:36
@kibana-ci
Copy link

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
guidedOnboarding 25.1KB 25.2KB +114.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 58 64 +6
osquery 108 113 +5
securitySolution 440 446 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 66 72 +6
osquery 109 115 +6
securitySolution 517 523 +6
total +20

History

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

@yuliacech yuliacech merged commit db744ad into elastic:main Nov 8, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Nov 8, 2022
@yuliacech yuliacech deleted the guided_onboarding/8.6_api_fixes_intialization branch November 22, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Journey/Onboarding Platform Journey Onboarding team v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants