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
  • Loading branch information
mwangggg authored Nov 1, 2023
1 parent c75c36a commit 792a894
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 @@ -274,6 +274,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 @@ -344,8 +347,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 792a894

Please sign in to comment.