-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
fix: Mutex never gets released on refresh function of AccountTrackerController #4270
Conversation
…count tracker controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff looks great! Would you mind filling out the rest of the PR template?
And for the change entry, I would suggest rewording it to describe how the behavior has changed, rather than what we did to change it.
e.g. something like:
### Fixed
- Ensure mutex is released when refresh succeeds
- Previously the `refresh` method would remain locked indefinitely after it was run successfully. The mutex was only released upon failure.
Added! By mistake I left my description under the comments of the PR template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Explanation
Currently the mutex do not get released unless there is an error thrown by the
getBalanceFromChain
functionFixed by move the release of the murex to the finally block. It was also removed unnecessary catch block.
Now the mutex gets released when the logic of refresh runs successfully
Fixed
refresh
method would remain locked indefinitely after it was run successfully. The mutex was only released upon failure.References
Changelog
@metamask/assets-controllers
Checklist