-
Notifications
You must be signed in to change notification settings - Fork 87
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
refactor: simplify refresh balance triggers #6232
base: main
Are you sure you want to change the base?
Conversation
createFiatConnectTransferCompleted.type, | ||
depositTransactionSucceeded.type, | ||
swapSuccess.type, | ||
], |
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.
this is the main change
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6232 +/- ##
==========================================
- Coverage 88.98% 88.96% -0.02%
==========================================
Files 737 737
Lines 31449 31423 -26
Branches 5828 5521 -307
==========================================
- Hits 27984 27955 -29
- Misses 3267 3424 +157
+ Partials 198 44 -154
... and 65 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Description
This PR consolidates the way we are refreshing the token balances. I think we let this evolve organically for some time and it has become buggy and inconsistent.
Currently, before this change:
fetchTokenBalances
action after every flow that initiates a transaction. i think it is probably unavoidable to need to remember to trigger a balance fetch, but currently we dispatch a success action for the flow and a separate action for the balances (the dreaded double dispatch)This change:
fetchTokenBalances
action entirely and instead, trigger the balance refresh sagas on specific actions. i've tried to document them all.home
reducer, most flows were never allowing this loading state to be set. only the send flow was, i think that's a bug. balance refreshes should be a background task and not affect whether we show or hide the balance....Test plan
I should see a network request to refresh token balance, exchange rate, positions, shortcuts when I have:
Related issues
Backwards compatibility
yes
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: