Currently, when a new SdkSynchronizer is created, it triggers CompactBlockProcessor.start(), which begins the sync process. SdkSynchronizer also exposes StateFlows for things like the wallet's Sapling balance. AFAICT these balance StateFlows are only updated once CompactBlockProcessor has successfully scanned at least one block. This leads to an artificial delay between opening an app, and the app being able to display balances and a non-zero sync percentage.
I think it is safe to just call getWalletSummary() immediately inside CompactBlockProcessor.start() (even before verifySetup()). By the time we call CompactBlockProcessor.start(), the wallet database has been created, so this just exposes its data to the SDK user.
Currently, when a new
SdkSynchronizer
is created, it triggersCompactBlockProcessor.start()
, which begins the sync process.SdkSynchronizer
also exposesStateFlow
s for things like the wallet's Sapling balance. AFAICT these balanceStateFlow
s are only updated onceCompactBlockProcessor
has successfully scanned at least one block. This leads to an artificial delay between opening an app, and the app being able to display balances and a non-zero sync percentage.I think it is safe to just call
getWalletSummary()
immediately insideCompactBlockProcessor.start()
(even beforeverifySetup()
). By the time we callCompactBlockProcessor.start()
, the wallet database has been created, so this just exposes its data to the SDK user.