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

getTagList returns incorrect result if tags are create after page loaded: #160723

Closed
angorayc opened this issue Jun 28, 2023 · 8 comments
Closed
Labels
bug Fixes for quality problems that affect the customer experience Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team

Comments

@angorayc
Copy link
Contributor

angorayc commented Jun 28, 2023

getTagList returns incorrect result if tags are create after page loaded (Hopefully we could get this in 8.10)

incorrect_getList

Steps to reproduce (as shown in the video below):

  1. Remove all the tags
  2. Visit Security Solution > Dashboards (It creates a Security Solution tag if there isn't one when landing on the page)
  3. Observe that getTagList always return empty value even tags created.
remove_tags.mov

Originally posted by @angorayc in #160540 (comment)

@botelastic botelastic bot added the needs-team Issues missing a team label label Jun 28, 2023
@angorayc angorayc added bug Fixes for quality problems that affect the customer experience Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Component:TableListView labels Jun 28, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jun 28, 2023
@sebelga
Copy link
Contributor

sebelga commented Jun 28, 2023

Hey @angorayc , sorry I must be very slow.

In the video you show:

  • Initially there are 3 tags in the drop down
  • Then you go to a different tab and delete the 3 tags
  • Then you go back to the previous tab, you refresh the page and show that there are no tags in the list

Isn't that what is expected? Not sure I see the issue.
Thanks.

@sebelga
Copy link
Contributor

sebelga commented Jun 29, 2023

It is possible that #160871 fixed this issue.
Let's re-verify after it is merged 👍

@sebelga sebelga self-assigned this Jul 19, 2023
@sebelga
Copy link
Contributor

sebelga commented Jul 19, 2023

This issue requires #160540 to be merged to be able to test and debug it.

As discussed over Slack you found a workaround so we can de-prioritise it and I'll have a look in a future sprint.

Note to clarify the issue: this is an edge case where the page embedding the TableListView component creates a new tag when being accessed which apparently is not visible by the tag filter panel of the table.

In theory it should work as we fetch the tag list every time the tag panel opens (https://github.com/elastic/kibana/blob/main/packages/content-management/table_list_view_table/src/components/use_tag_filter_panel.tsx#L168 & https://github.com/elastic/kibana/blob/main/packages/content-management/table_list_view_table/src/components/use_tag_filter_panel.tsx#L83) which get the latest state of the tags cache https://github.com/elastic/kibana/blob/main/x-pack/plugins/saved_objects_tagging/public/ui_api/get_tag_list.ts#L11).

@angorayc angorayc added Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore and removed Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Component:TableListView labels Jul 19, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@sebelga
Copy link
Contributor

sebelga commented Jul 19, 2023

Looking at the security plugin code where the tag is being created I see in
https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/common/containers/tags/api.ts#L18

export const createTag = (
  { http, tag }: { http: HttpSetup; tag: Omit<TagAttributes, 'color'> & { color?: string } },
  abortSignal?: AbortSignal
): Promise<Tag> =>
  http.put(INTERNAL_TAGS_URL, {
    body: JSON.stringify(tag),
    signal: abortSignal,
  });

which is not using the tags client.

To solve this issue you need to create your tag using the saved_object_tagging plugin client (exposed from the start contract here https://github.com/elastic/kibana/blob/main/src/plugins/saved_objects_tagging_oss/public/api.ts#L25).

@sebelga sebelga removed their assignment Jul 19, 2023
@angorayc
Copy link
Contributor Author

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 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team
Projects
None yet
Development

No branches or pull requests

3 participants