Skip to content
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: Refresh balance immediately after starting the app for the first time and when adding a new account #1654

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

clangenb
Copy link
Member

@clangenb clangenb commented Mar 6, 2024

This removes the kind of hacky balance watchdog we had implemented. The reason is that it was for some reason very slow to update, and that showing the notifications of incoming balance diffs was broken anyhow since some flutter update. I suggest re-introducing this notification with the indexer instead, such that we can actually show incoming transfers instead of incoming balance diffs, #1656. Also, this fixes the jumping balance after a network switch. Closes #1530.

I integrated the periodic update of the encointer balance into the overall state update. As the balance update is now blazingly fast, I simplified the getter to only fetch the balance for the currently chosen community instead of getting the non-zero balances of all communities. This removed quite some complexity o f the callback function. However, we might want to integrate the RPC to get all balances in another way: #1655

@@ -104,6 +104,25 @@ abstract class _EncointerAccountStore with Store {
writeToCache();
}

@action
double addBalanceEntryAndReturnDelta(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently unused, but if we ever want to show incoming balance deltas again, we can use it.

@clangenb clangenb added A1-bugfix PR fixes a bug B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes labels Mar 6, 2024
@clangenb clangenb merged commit 120a5c3 into master Mar 6, 2024
14 of 20 checks passed
@clangenb clangenb deleted the cl/fix-balance-update branch March 6, 2024 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A1-bugfix PR fixes a bug B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jumping balance when switching network
1 participant