You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading an identity's token balances fails, the wallet library hides the failure. Apps then show "no balance" or a zero balance for tokens nobody actually checked.
User story
As a wallet user, I want my app to tell me when it could not check a token balance, so that I never take "no balance" or "0" for a confirmed result.
Scenario
Steps to reproduce
Register an identity's tokens for balance sync in platform-wallet.
Make TokenAmount::fetch_many fail for one or every batch (network error, DAPI timeout).
Call sync_now and read the token balances.
Actual behavior
sync_now returns () as if the pass succeeded. A token whose batch failed keeps its previous cached value, or its zero-valued registration placeholder when no value was ever fetched. The caller cannot tell a checked balance from an unchecked one.
Expected behavior
The caller learns which tokens were checked successfully and which reads failed, so it can show an unknown or error state instead of a confirmed absence or zero.
Detailed discussion
packages/rs-platform-wallet/src/manager/identity_sync.rs, sync_identity: on Err from TokenAmount::fetch_many, the batch is logged at warn and skipped ("leaving cache untouched for this batch"). If every batch fails, the function returns early. Neither case reaches the caller. The behavior is on v5.1-dev and on the revision Dash Evo Tool pins (575d961).
Partial failure is worse than total failure: when one batch succeeds and another fails, apply_fresh_balances runs, and the failed batch's tokens keep zero-valued registration placeholders. Readers of the cache then treat those zeros as known balances.
Suggested direction: return a structured per-token (or per-batch) outcome from the sync pass (Checked(Option<TokenAmount>) / Failed(error)), or record the read status next to each cached balance. Consumers such as Dash Evo Tool (dashpay/dash-evo-tool#1160) can then keep a token's state unknown when its read failed.
Activity