-
Notifications
You must be signed in to change notification settings - Fork 178
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: make <AccountDropdown />
less infuriating
#7571
Merged
gomesalexandre
merged 5 commits into
develop
from
fix_accountdropdown_infuriating_behavior
Aug 23, 2024
Merged
fix: make <AccountDropdown />
less infuriating
#7571
gomesalexandre
merged 5 commits into
develop
from
fix_accountdropdown_infuriating_behavior
Aug 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gomesalexandre
commented
Aug 20, 2024
gomesalexandre
commented
Aug 20, 2024
gomesalexandre
commented
Aug 20, 2024
gomesalexandre
commented
Aug 20, 2024
gomesalexandre
commented
Aug 20, 2024
Few cleanup suggestions: #7607 |
gomesalexandre
force-pushed
the
fix_accountdropdown_infuriating_behavior
branch
from
August 22, 2024 23:21
7c6b184
to
c44db7a
Compare
kaladinlight
approved these changes
Aug 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR fixes this guy #7509 (comment):
This issue, as was found out after losing a bit of sanity and brain cells, was caused by
<AccountDropdown />
reactivity, and ultimatelyselectPortfolioAccountIdsByAssetIdFilter
lack therof.quoting big @woodenfurniture on that one:
Indeed, the amount of rerenders is infuriating, although a bit less currently as a result of the current
createCachedSelector
use, which was hiding the actual underlying issue.selectPortfolioAccountIdsByAssetIdFilter
being acreateCachedSelector
, it doesn't trigger reactivity when going back and forth between wallets. This is supposedly a feature, not a bug...<RFOXHeader />
was never reactive onaccountIds
as it should, yielding unreliable resultsselectPortfolioAccountIdsByAssetIdFilter
a good ol'isEqual
selector should fix this, this isn't enough. Doing so will make<AccountDropdown />
infinitely rerender, as proper checks are not in place, but this component was accidentally happy previously as a result of the lack of reactivity of the selector mentioned above.Pull Request Type
Issue (if applicable)
N/A
Risk
Medium - this doesn't only affect RFOX, but all components leveraging
<AccountDropdown />
multi-account selectionTesting
Engineering
Operations
Screenshots (if applicable)
https://jam.dev/c/a4af9fca-51d0-4710-b17d-09fbb82d586c
https://jam.dev/c/c027dd53-62ac-43d6-bca2-e1dda20516e4
https://jam.dev/c/d0467a43-9290-4b81-b6c7-6fd23af20d48