Skip to content

[Logs UI] Fix Log Categorization UI failure due to infinite loop - #159090

Merged
tonyghiani merged 2 commits into
elastic:mainfrom
tonyghiani:158930-fix-broken-logs-categories
Jun 6, 2023
Merged

tonyghiani merged 2 commits into
elastic:mainfrom
tonyghiani:158930-fix-broken-logs-categories

Conversation

@tonyghiani

@tonyghiani tonyghiani commented Jun 6, 2023 •

Copy link
Copy Markdown
Contributor

📓 Summary

Closes #158930

With the usage of the logViewReference object (instead of the primitive sourceId) as a dependency for the log entries categories data fetching, the useTrackedPromise was continuously recreating the getLogEntryCategoryDatasets and getTopLogEntryCategories fetchers, which were consequently causing an infinite loop when called inside the related side effect and used as dependency.

Using the logViewReference.logViewId property (equivalent to the legacy sourceId string) restores the expected behaviour.

@tonyghiani tonyghiani added release_note:fix Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services backport:prev-minor labels Jun 6, 2023
@tonyghiani
tonyghiani requested a review from a team as a code owner June 6, 2023 08:50
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@ghost

ghost commented Jun 6, 2023

Copy link
Copy Markdown

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@kibana-ci

Copy link
Copy Markdown

💚 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
infra 2.0MB 2.0MB +20.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 413 417 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 497 501 +4
total +6

History

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

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@tonyghiani
tonyghiani merged commit d6105d0 into elastic:main Jun 6, 2023
@tonyghiani
tonyghiani deleted the 158930-fix-broken-logs-categories branch June 6, 2023 11:31
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 6, 2023
…stic#159090)

## 📓 Summary

With the usage of the `logViewReference` object (instead of the
primitive `sourceId`) as a dependency for the log entries categories
data fetching, the `useTrackedPromise` was continuously recreating the
`getLogEntryCategoryDatasets` and `getTopLogEntryCategories` fetchers,
which were consequently causing an infinite loop when called inside the
related side effect and used as dependency.

Using the `logViewReference.logViewId` property (equivalent to the
legacy `sourceId` string) restores the expected behaviour.

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
(cherry picked from commit d6105d0)
@kibanamachine

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
✅ 8.8

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 6, 2023
#159090) (#159106)

# Backport

Closes #158930 

This will backport the following commits from `main` to `8.8`:
- [[Logs UI] Fix Log Categorization UI failure due to infinite loop
(#159090)](#159090)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2023-06-06T11:31:03Z","message":"[Logs
UI] Fix Log Categorization UI failure due to infinite loop
(#159090)\n\n## 📓 Summary\r\n\r\nWith the usage of the
`logViewReference` object (instead of the\r\nprimitive `sourceId`) as a
dependency for the log entries categories\r\ndata fetching, the
`useTrackedPromise` was continuously recreating
the\r\n`getLogEntryCategoryDatasets` and `getTopLogEntryCategories`
fetchers,\r\nwhich were consequently causing an infinite loop when
called inside the\r\nrelated side effect and used as
dependency.\r\n\r\nUsing the `logViewReference.logViewId` property
(equivalent to the\r\nlegacy `sourceId` string) restores the expected
behaviour.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"d6105d0bfe0634a0543e52ce3c1275ad0bd64250","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Logs
UI","Team:Infra Monitoring
UI","backport:prev-minor","v8.9.0"],"number":159090,"url":"https://github.com/elastic/kibana/pull/159090","mergeCommit":{"message":"[Logs
UI] Fix Log Categorization UI failure due to infinite loop
(#159090)\n\n## 📓 Summary\r\n\r\nWith the usage of the
`logViewReference` object (instead of the\r\nprimitive `sourceId`) as a
dependency for the log entries categories\r\ndata fetching, the
`useTrackedPromise` was continuously recreating
the\r\n`getLogEntryCategoryDatasets` and `getTopLogEntryCategories`
fetchers,\r\nwhich were consequently causing an infinite loop when
called inside the\r\nrelated side effect and used as
dependency.\r\n\r\nUsing the `logViewReference.logViewId` property
(equivalent to the\r\nlegacy `sourceId` string) restores the expected
behaviour.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"d6105d0bfe0634a0543e52ce3c1275ad0bd64250"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159090","number":159090,"mergeCommit":{"message":"[Logs
UI] Fix Log Categorization UI failure due to infinite loop
(#159090)\n\n## 📓 Summary\r\n\r\nWith the usage of the
`logViewReference` object (instead of the\r\nprimitive `sourceId`) as a
dependency for the log entries categories\r\ndata fetching, the
`useTrackedPromise` was continuously recreating
the\r\n`getLogEntryCategoryDatasets` and `getTopLogEntryCategories`
fetchers,\r\nwhich were consequently causing an infinite loop when
called inside the\r\nrelated side effect and used as
dependency.\r\n\r\nUsing the `logViewReference.logViewId` property
(equivalent to the\r\nlegacy `sourceId` string) restores the expected
behaviour.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"d6105d0bfe0634a0543e52ce3c1275ad0bd64250"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
@mistic

mistic commented Jun 8, 2023

Copy link
Copy Markdown
Contributor

This PR backport didn't make it into the latest BC for 8.8.1. Updating the labels.

@mistic mistic added v8.8.2 and removed v8.8.1 labels Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Logs UI Logs UI feature release_note:fix Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.8.2 v8.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log Categorization UI fails to load on 8.8

6 participants