-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[9.0] [SecuritySolution] Make last conversation local storage keys space aware (#214794) #216214
Open
angorayc
wants to merge
9
commits into
elastic:9.0
Choose a base branch
from
angorayc:backport/9.0/pr-214794
base: 9.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+219
−66
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…are (elastic#214794) Issue and steps to reproduce: elastic#214114 https://github.com/user-attachments/assets/881fb082-a879-4816-b251-da3f2af77661 The best approach to fix this is to make local storage keys space aware. In this use case, the current key is `elasticAssistantDefault.lastSelectedConversation`. Ideally it should be e.g.: `elasticAssistantDefault.lastSelectedConversation.{spaceId}` To retrieve spaceId properly, we have to make sure spaceId has been available when reading the local storage. In other words, the spaceId cannot be null, undefined, or a fallback value when accessing it. To achieve that, we have to only render the assistant overlay after spaceId is available and remove existing spaceId from the AssistantContext. The reason I removed spaceId from AssistantContext is because it is at the top of the rendering tree and can block the entire app if waiting for the spaceId becomes available there. `useAssistantSpaceId` comes from `SpaceIdContext` which should be render only when spaceId is available, should be safe to access the exact spaceId inside Assistant overly. Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [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 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 169abec)
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
|
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
main
to9.0
: