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

[Cases] Fix attachment's renderer memoization #156179

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Apr 28, 2023

Summary

PR #154436 changed the memoization function (my fault 🙂) and that caused the attachments to rerender each time a user does an action in cases. This PR fixes this issue.

Before:

Screen.Recording.2023-04-28.at.5.12.10.PM.mov

After:

Screen.Recording.2023-04-28.at.5.11.32.PM.mov

For maintainers

@cnasikas cnasikas added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature labels Apr 28, 2023
@cnasikas cnasikas requested a review from a team as a code owner April 28, 2023 14:09
@cnasikas cnasikas self-assigned this Apr 28, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@cnasikas cnasikas added bug Fixes for quality problems that affect the customer experience v8.8.0 v8.9.0 release_note:skip Skip the PR/issue when compiling release notes labels Apr 28, 2023
Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

verified locally, looks good 👍

@kibana-ci
Copy link
Collaborator

💚 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
cases 376.8KB 376.8KB +5.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 399 402 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 479 482 +3
total +5

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

cc @cnasikas

@cnasikas cnasikas merged commit 60e3d98 into elastic:main Apr 28, 2023
@cnasikas cnasikas deleted the fix_bug_rerender_attachment branch April 28, 2023 16:14
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 28, 2023
## Summary

PR elastic#154436 changed the memoization
function (my fault 🙂) and that caused the attachments to rerender each
time a user does an action in cases. This PR fixes this issue.

**Before:**

https://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov

**After:**

https://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 60e3d98)
@kibanamachine
Copy link
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 Apr 28, 2023
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Cases] Fix attachment's renderer memoization
(#156179)](#156179)

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

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

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2023-04-28T16:14:41Z","message":"[Cases]
Fix attachment's renderer memoization (#156179)\n\n## Summary\r\n\r\nPR
#154436 changed the
memoization\r\nfunction (my fault 🙂) and that caused the attachments to
rerender each\r\ntime a user does an action in cases. This PR fixes this
issue.\r\n\r\n**Before:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov\r\n\r\n**After:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [x] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"60e3d98ba837d31130bf104681381ebe5a2df5c2","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","Feature:Cases","v8.8.0","v8.9.0"],"number":156179,"url":"https://github.com/elastic/kibana/pull/156179","mergeCommit":{"message":"[Cases]
Fix attachment's renderer memoization (#156179)\n\n## Summary\r\n\r\nPR
#154436 changed the
memoization\r\nfunction (my fault 🙂) and that caused the attachments to
rerender each\r\ntime a user does an action in cases. This PR fixes this
issue.\r\n\r\n**Before:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov\r\n\r\n**After:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [x] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"60e3d98ba837d31130bf104681381ebe5a2df5c2"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156179","number":156179,"mergeCommit":{"message":"[Cases]
Fix attachment's renderer memoization (#156179)\n\n## Summary\r\n\r\nPR
#154436 changed the
memoization\r\nfunction (my fault 🙂) and that caused the attachments to
rerender each\r\ntime a user does an action in cases. This PR fixes this
issue.\r\n\r\n**Before:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov\r\n\r\n**After:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [x] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"60e3d98ba837d31130bf104681381ebe5a2df5c2"}}]}]
BACKPORT-->

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
cnasikas added a commit that referenced this pull request May 26, 2023
## Summary

In #156179 I fixed a bug with the
memorization of the react components of registered attachments in Cases.
This fix introduced another bug which I am fixing in this PR.

Fixes: #158447

### Bug


https://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff

### Fix


https://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Fix a bug where ML embeddables, OsQuery, and IoCs attachments in a case
render the wrong view.
cnasikas added a commit to cnasikas/kibana that referenced this pull request May 26, 2023
## Summary

In elastic#156179 I fixed a bug with the
memorization of the react components of registered attachments in Cases.
This fix introduced another bug which I am fixing in this PR.

Fixes: elastic#158447

### Bug

https://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff

### Fix

https://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Fix a bug where ML embeddables, OsQuery, and IoCs attachments in a case
render the wrong view.

(cherry picked from commit a2a0860)

# Conflicts:
#	x-pack/test/functional_with_es_ssl/apps/cases/group2/attachment_framework.ts
cnasikas added a commit that referenced this pull request May 26, 2023
#158559)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Cases] Fix bug with registered attachmets memoization
(#158441)](#158441)

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

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

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2023-05-26T12:43:43Z","message":"[Cases]
Fix bug with registered attachmets memoization (#158441)\n\n##
Summary\r\n\r\nIn #156179 I fixed
a bug with the\r\nmemorization of the react components of registered
attachments in Cases.\r\nThis fix introduced another bug which I am
fixing in this PR.\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/158447\r\n\r\n###
Bug\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff\r\n\r\n###
Fix\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n##
Release notes\r\n\r\nFix a bug where ML embeddables, OsQuery, and IoCs
attachments in a case\r\nrender the wrong
view.","sha":"a2a0860f65013167a8e097d821eefa7fe81b8832","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:ResponseOps","Feature:Cases","v8.9.0","v8.8.1"],"number":158441,"url":"https://github.com/elastic/kibana/pull/158441","mergeCommit":{"message":"[Cases]
Fix bug with registered attachmets memoization (#158441)\n\n##
Summary\r\n\r\nIn #156179 I fixed
a bug with the\r\nmemorization of the react components of registered
attachments in Cases.\r\nThis fix introduced another bug which I am
fixing in this PR.\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/158447\r\n\r\n###
Bug\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff\r\n\r\n###
Fix\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n##
Release notes\r\n\r\nFix a bug where ML embeddables, OsQuery, and IoCs
attachments in a case\r\nrender the wrong
view.","sha":"a2a0860f65013167a8e097d821eefa7fe81b8832"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/158441","number":158441,"mergeCommit":{"message":"[Cases]
Fix bug with registered attachmets memoization (#158441)\n\n##
Summary\r\n\r\nIn #156179 I fixed
a bug with the\r\nmemorization of the react components of registered
attachments in Cases.\r\nThis fix introduced another bug which I am
fixing in this PR.\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/158447\r\n\r\n###
Bug\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff\r\n\r\n###
Fix\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n##
Release notes\r\n\r\nFix a bug where ML embeddables, OsQuery, and IoCs
attachments in a case\r\nrender the wrong
view.","sha":"a2a0860f65013167a8e097d821eefa7fe81b8832"}},{"branch":"8.8","label":"v8.8.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants