Skip to content

CP-12886 - Balance Service follow ups#3442

Merged
bogdandobritoiu merged 38 commits intomainfrom
bogdan/CP-12886
Jan 27, 2026
Merged

CP-12886 - Balance Service follow ups#3442
bogdandobritoiu merged 38 commits intomainfrom
bogdan/CP-12886

Conversation

@bogdandobritoiu
Copy link
Copy Markdown
Contributor

@bogdandobritoiu bogdandobritoiu commented Dec 17, 2025

Description

Ticket: CP-12886
Ticket: CP-13100

Refactored the balance loading logic into a single request to get all accounts and reuse that hook everywhere for the wallet overview screen.

  • added new function inside BalanceService for getBalancesForAccounts which loads all accounts.
  • used useAllBalances for requesting all balances
  • refactored AccountBalance and WalletBalance to load data from useAllBalances
  • stopped the accordions from closing when adding account or when refreshing
  • added batching multiple accounts loaded (over 50)

Screenshots/Videos

Screen.Recording.2025-12-17.at.21.50.40.mov

Error case

Simulator.Screen.Recording.-.26.-.2025-12-17.at.23.40.33.mov

Testing

iOS - 7174
Android - 7175

Dev Testing (if applicable)

To properly test you need wallets with many accounts. 50+ accounts would be best to fully test this.

  1. Open up Wallets overview and verify if balances are loaded fast
  2. Try adding an account to any wallet, it should show the loading indicator only for that account and when it finishes the wallet balance total should also include that the new account
  3. Try stress testing the screen, first load should show skeletons and then data should be cached on new screen open
  4. Try opening account details and closing a couple of times, verify it doesn't freeze the app in any way

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have included screenshots / videos of android and ios
  • I have added testing steps
  • I have added/updated necessary unit tests
  • I have updated the documentation

@bogdandobritoiu bogdandobritoiu changed the title Bogdan/cp 12886 CP-12886 - Balance Service follow ups Dec 17, 2025
Comment thread packages/core-mobile/app/new/features/wallets/components/AccountBalance.tsx Outdated
Comment thread packages/core-mobile/app/new/features/portfolio/hooks/useAccountsBalances.ts Outdated
Comment thread packages/core-mobile/app/new/features/portfolio/hooks/useAllBalances.ts Outdated
- BranchSDK (= 3.12.2)
- React-Core
- react-native-compat (2.23.0):
- react-native-compat (2.11.0):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

reason we moved backwards with this package?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any idea here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've reverted it.

Copy link
Copy Markdown
Contributor

@B0Y3R-AVA B0Y3R-AVA left a comment

Choose a reason for hiding this comment

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

Great work! few small nitpicks and questions

B0Y3R-AVA
B0Y3R-AVA previously approved these changes Jan 23, 2026
Comment thread packages/core-mobile/app/new/features/portfolio/hooks/useIsPollingAllBalances.ts Outdated
Comment thread packages/core-mobile/app/new/features/wallets/components/WalletBalance.tsx Outdated
Comment thread packages/core-mobile/app/new/features/wallets/screens/WalletsScreen.tsx Outdated
Comment thread packages/k2-alpine/src/components/LoadingContent/LoadingContent.tsx Outdated
Comment thread packages/core-mobile/app/utils/apiClient/balance/balanceApi.ts Outdated
Comment thread packages/core-mobile/app/utils/apiClient/balance/balanceApi.ts Outdated
Comment thread packages/core-mobile/app/services/balance/BalanceService.ts Outdated
Comment thread packages/core-mobile/app/services/balance/BalanceService.ts Outdated
Copy link
Copy Markdown
Collaborator

@atn4z7 atn4z7 left a comment

Choose a reason for hiding this comment

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

great work!!

Copy link
Copy Markdown
Contributor

@onghwan onghwan left a comment

Choose a reason for hiding this comment

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

dev-tested

@bogdandobritoiu bogdandobritoiu merged commit 90669a3 into main Jan 27, 2026
4 checks passed
@bogdandobritoiu bogdandobritoiu deleted the bogdan/CP-12886 branch January 27, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants