Skip to content

Commit a98850b

Browse files
[9.1] [Security Solution] Fixes react-query id collision (elastic#240517) (elastic#240889)
# Backport This will backport the following commits from `main` to `9.1`: - [[Security Solution] Fixes react-query id collision (elastic#240517)](elastic#240517) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Davis Plumlee","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-24T21:33:12Z","message":"[Security Solution] Fixes react-query id collision (elastic#240517)\n\n## Summary\n\nAddresses https://github.com/elastic/security-team/issues/14369\n(internal)\n\nUpdates one of the two places we use the react query key \"integrations\"\nto be something different so it doesn't use the incorrect cache when\nreading. This was causing page failures when going from a page that used\none integrations query to one that used another. We fetch integrations 2\nseparate ways in these queries and they should not share their key.\n\nThe other file that uses the `integrations` key label is\n`x-pack/solutions/security/plugins/security_solution/public/detection_engine/common/components/related_integrations/use_integrations.tsx`.\nI just changed the most recent file between the two.\n\n### Testing steps\n1. Have an instance with prebuilt rules installed that contain related\nintegrations (installing all prebuilt rules will do this)\n2. Go to the `Intellegence` page in the security app\n3. Navigate to the `Detection Rules` page under the `Rules` tab in the\nnavigation sidebar\n4. See that the page loads without error\n\n### Videos\n\n\nhttps://github.com/user-attachments/assets/9245a569-8686-4c11-bb11-a0512764722f\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"deee40570b9a1dc7293a0fbf05327e1bdf886545","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Team:Threat Hunting:Investigations","backport:version","v9.3.0","v9.1.7","v9.2.1"],"title":"[Security Solution] Fixes react-query id collision","number":240517,"url":"https://github.com/elastic/kibana/pull/240517","mergeCommit":{"message":"[Security Solution] Fixes react-query id collision (elastic#240517)\n\n## Summary\n\nAddresses https://github.com/elastic/security-team/issues/14369\n(internal)\n\nUpdates one of the two places we use the react query key \"integrations\"\nto be something different so it doesn't use the incorrect cache when\nreading. This was causing page failures when going from a page that used\none integrations query to one that used another. We fetch integrations 2\nseparate ways in these queries and they should not share their key.\n\nThe other file that uses the `integrations` key label is\n`x-pack/solutions/security/plugins/security_solution/public/detection_engine/common/components/related_integrations/use_integrations.tsx`.\nI just changed the most recent file between the two.\n\n### Testing steps\n1. Have an instance with prebuilt rules installed that contain related\nintegrations (installing all prebuilt rules will do this)\n2. Go to the `Intellegence` page in the security app\n3. Navigate to the `Detection Rules` page under the `Rules` tab in the\nnavigation sidebar\n4. See that the page loads without error\n\n### Videos\n\n\nhttps://github.com/user-attachments/assets/9245a569-8686-4c11-bb11-a0512764722f\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"deee40570b9a1dc7293a0fbf05327e1bdf886545"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/240517","number":240517,"mergeCommit":{"message":"[Security Solution] Fixes react-query id collision (elastic#240517)\n\n## Summary\n\nAddresses https://github.com/elastic/security-team/issues/14369\n(internal)\n\nUpdates one of the two places we use the react query key \"integrations\"\nto be something different so it doesn't use the incorrect cache when\nreading. This was causing page failures when going from a page that used\none integrations query to one that used another. We fetch integrations 2\nseparate ways in these queries and they should not share their key.\n\nThe other file that uses the `integrations` key label is\n`x-pack/solutions/security/plugins/security_solution/public/detection_engine/common/components/related_integrations/use_integrations.tsx`.\nI just changed the most recent file between the two.\n\n### Testing steps\n1. Have an instance with prebuilt rules installed that contain related\nintegrations (installing all prebuilt rules will do this)\n2. Go to the `Intellegence` page in the security app\n3. Navigate to the `Detection Rules` page under the `Rules` tab in the\nnavigation sidebar\n4. See that the page loads without error\n\n### Videos\n\n\nhttps://github.com/user-attachments/assets/9245a569-8686-4c11-bb11-a0512764722f\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios","sha":"deee40570b9a1dc7293a0fbf05327e1bdf886545"}},{"branch":"9.1","label":"v9.1.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Davis Plumlee <[email protected]>
1 parent cfd930a commit a98850b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/hooks/use_integrations.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const createWrapper = (): FC<PropsWithChildren<{}>> => {
2020
};
2121

2222
const renderUseQuery = (result: { items: unknown[] }) =>
23-
renderHook(() => useQuery(['integrations'], () => result), {
23+
renderHook(() => useQuery(['integrations-threat-intel'], () => result), {
2424
wrapper: createWrapper(),
2525
});
2626

x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/hooks/use_integrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface Integration {
2626
status: IntegrationInstallStatus;
2727
}
2828

29-
const queryKey = ['integrations'];
29+
const queryKey = ['integrations-threat-intel'];
3030

3131
/**
3232
* Retrieves integrations from the Fleet plugin endpoint /api/fleet/epm/packages.

0 commit comments

Comments
 (0)