Skip to content

Commit

Permalink
chore(topology): check for jvmId in notifications from Cryostat (#1152)…
Browse files Browse the repository at this point in the history
… (#1154)

(cherry picked from commit 792a894)

Co-authored-by: Ming Yu Wang <[email protected]>
  • Loading branch information
mergify[bot] and mwangggg authored Nov 1, 2023
1 parent a2ac34d commit 37229d6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/Topology/Entity/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <R = ResourceTypes,>(
targetNode: TargetNode,
Expand Down Expand Up @@ -345,8 +348,13 @@ export const useResources = <R = ResourceTypes,>(
)
.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
Expand Down

0 comments on commit 37229d6

Please sign in to comment.