ui: Remove useEffect fn responsible for resetting current icicle path #3173
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.
This fixes the bug in #1991.
Steps to reproduce bug
Expand something in the icicle graphClick on root nodeA couple of things to note:
TL:DR: Removed the
navigateTo
function as a dependency in the useEffect hook in the in theuseURLState
hook.This bug doesn't seem to happen in Parca but only on PSC. After some investigating, I discovered this is because this useEffect keeps firing after a function filter has been removed i.e. setting the
curPath
to be an array, effectively causing the icicle graph to reset immediately after any clicking interaction with it.Since this only takes place after the function filter is removed, I was able to isolate (did this by commenting the
setStoreValue
line out, and manually updating the URL with afilter_by_function
query param and then deleting it. The icicle graph did not reset after this manual update) the bug to the setStoreValue function in theFilterByFunctionbutton
component. ThesetStoreValue
function is retrieved from theuseURLState
hook.Therefore the reason for the infinite re-rendering had to be in the
useURLState
hook, and probably theuseEffect
hook, which had a couple of dependencies, which it used to determine whether to re-render. So I thought to remove thenavigateTo
function as a dependency in the useEffect hook in the in theuseURLState
hook.Screen.Recording.2023-05-25.at.17.27.43.480.mov