fix(topology): merge topology elements on update (backport #1560) #1561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Fixes: #122
Description of the change:
This change switches the boolean in
visualization.fromModel()
in TopologyGraphView from false to true, in-order to "merge" the topology elements on update instead of removing and rebuilding them.Motivation for the change:
What seems to be the issue is that when the boolean is false the visualization clears out all the old elements before re-creating them. This results in the error because it ends up setting the controller to undefined, but during the process of destroying the colalayout there is a check for that controller.
With merge set to true the old elements are cleaned up after the new elements are created, and we don't run into this issue where the controller doesn't exist.
Before:
![errors](https://private-user-images.githubusercontent.com/10425301/410127503-079c309a-4cdf-4ae3-880f-f193d9b92fc3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNzc5MjgsIm5iZiI6MTczOTM3NzYyOCwicGF0aCI6Ii8xMDQyNTMwMS80MTAxMjc1MDMtMDc5YzMwOWEtNGNkZi00YWUzLTg4MGYtZjE5M2Q5YjkyZmMzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE2MjcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5MjUwMDFmMDgyZDZmNTQ4ZThmOGJjOTFjYjQyNWJjZWJmNDk4ODNmNTNlYmNlZGMwMDBiMGQ0ZTVkOTMwYzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._r6ncUSI57-XGBULlu9q-gKRSKzxphlkIWGeoGVj574)
After:
![no errors](https://private-user-images.githubusercontent.com/10425301/410127363-8b3200cd-0454-40a6-8747-30a938d2260d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNzc5MjgsIm5iZiI6MTczOTM3NzYyOCwicGF0aCI6Ii8xMDQyNTMwMS80MTAxMjczNjMtOGIzMjAwY2QtMDQ1NC00MGE2LTg3NDctMzBhOTM4ZDIyNjBkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE2MjcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkOTg5ZmMzNzk4MzQyMjc1MjVjYWFjNDhiOTQxYTM2YzRhNmUyZWU4NzNlMjFmMmU1NDc2YzFiMjcwZjhhMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xlOyF9RJklEGVny7x-43ry9gmIcc_pnCQd8OmoHtyhg)
This is an automatic backport of pull request #1560 done by [Mergify](https://mergify.com).