2.0: refactor changing aliases in state and fix loading bar bug #2704
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.
Why does this PR exist?
Closes #2642
There was a loading bar that appeared when you renamed a token group, that never disappeared.
What does this pull request do?
The change fixing this issue is actually fairly small, I just removed the job that we had for this. The job itself was not an async operation, so there was no need for the loading bar. I assume it could have been a race condition that caused the start job and the stop job to never be submitted.
However, doing this I refactored how we call that
updateAlias
function as I discovered we had quite a mess there including a lot of logic directly in state which was not tested, aupdateOtherAlias
function which had no use. It basically was required as previously we didnt update modifier props when we update the aliases, but now I changed that to just happen before we perform the alias change, and added tests for that function, plus moved it to a dedicated newutils
directory in the store where we should move all logic that currently clutters the tokenState.Testing this change
Test coverage is pretty good with that one, but here's a video demonstrating the change:
CleanShot.2024-04-28.at.13.38.00.mp4
Additional Notes (if any)
We should really start to clean up our
tokenState
and move all the logic into dedicated files that we can test in isolation.