From 37229d6cf93f07dc6de086f7cab6747a116217d1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:30:28 -0400 Subject: [PATCH] chore(topology): check for jvmId in notifications from Cryostat (#1152) (#1154) (cherry picked from commit 792a894a2546818f83b74b380b88f246c54ee2cf) Co-authored-by: Ming Yu Wang <90855268+mwangggg@users.noreply.github.com> --- src/app/Topology/Entity/utils.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/Topology/Entity/utils.tsx b/src/app/Topology/Entity/utils.tsx index cc1ee4313..1da04e3c5 100644 --- a/src/app/Topology/Entity/utils.tsx +++ b/src/app/Topology/Entity/utils.tsx @@ -275,6 +275,9 @@ export const getExpandedResourceDetails = ( export const getConnectUrlFromEvent = (event: NotificationMessage): string | undefined => { return event.message.target || event.message.targetId; }; +export const getJvmIdFromEvent = (event: NotificationMessage): string | undefined => { + return event.message.jvmId; +}; export const useResources = ( targetNode: TargetNode, @@ -345,8 +348,13 @@ export const useResources = ( ) .subscribe(([targetNode, event]) => { const extractedUrl = getConnectUrlFromEvent(event); + const extractedJvmId = getJvmIdFromEvent(event); const isOwned = isOwnedResource(resourceType); - if (!isOwned || (extractedUrl && extractedUrl === targetNode.target.connectUrl)) { + if ( + !isOwned || + (extractedUrl && extractedUrl === targetNode.target.connectUrl) || + (extractedJvmId && extractedJvmId === targetNode.target.jvmId) + ) { setLoading(true); setResources((old) => { // Avoid accessing state directly, which