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

[Bug] GraphElement with ID 'cryostat-target-topology-graph' has no controller #122

Closed
andrewazores opened this issue Feb 5, 2025 · 6 comments · Fixed by cryostatio/cryostat-web#1560
Labels
bug Something isn't working

Comments

@andrewazores
Copy link
Member

Current Behavior

The Topology view causes this error to appear in the browser console. In dev mode it causes the page to blow up with a webpack-dev-server "uncaught runtime error" overlay.

See discussions in #120

Expected Behavior

No response

Steps To Reproduce

No response

Environment

Anything else?

No response

@andrewazores
Copy link
Member Author

Labelled as a P2 (low priority, non-blocking) for 4.0 release since in full production builds/deployments it seems to be mostly harmless. If we find that it does cause runtime problems in production mode then this can be upgraded to a P1 or P0.

@tthvo
Copy link
Member

tthvo commented Feb 5, 2025

Previously caught during PF5 upgrade: cryostatio/cryostat-web#1334 (comment). I thought this PR cryostatio/cryostat-web#1336 would have fixed it but seems like it didnt :(

@aptmac
Copy link
Member

aptmac commented Feb 5, 2025

I've found something that works at the moment, just giving it a build and test against crc instead of smoketest.

I think it's this line in TopologyGraphView: https://github.com/cryostatio/cryostat-web/blob/main/src/app/Topology/GraphView/TopologyGraphView.tsx#L192

    // Initialize the controller with model to create nodes
    visualization.fromModel(model, false);

Changing the false -> true results in the stale elements being removed once all the new elements are created, and this fixes.


Background

When we set false above, Visualization immediately does a clear out of old elements (https://github.com/patternfly/react-topology/blob/dc28e8bf77e363eda3507a6b547ecafaa916a611/packages/module/src/Visualization.ts#L99), which ultimately results in the controller being set to undefined for the element (https://github.com/patternfly/react-topology/blob/dc28e8bf77e363eda3507a6b547ecafaa916a611/packages/module/src/Visualization.ts#L223, https://github.com/patternfly/react-topology/blob/main/packages/module/src/elements/BaseElement.ts#L95).

And this is where we see the stack trace on the ui. Ending the Cola Layout
Around the same time, ending the cola layout ends up looking for the controller of the BaseElement and throws the error because it's undefined.

@tthvo
Copy link
Member

tthvo commented Feb 5, 2025

Oh nice, that makes sense to me!!

@andrewazores
Copy link
Member Author

Previously caught during PF5 upgrade: cryostatio/cryostat-web#1334 (comment). I thought this PR cryostatio/cryostat-web#1336 would have fixed it but seems like it didnt :(

I have absolutely zero memory of that, clearly 😁

@tthvo
Copy link
Member

tthvo commented Feb 5, 2025

This is great! This issue has been bugging me for a while since PF5 upgrade. Finally off my mind haha :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants