mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 23:05:54 +00:00
fix: log and stop swallowing synchronous listenForUpdates() failures; retry NDK download in CI
BalancesUpdateSystem.launchChainUpdaters() wrapped updater.listenForUpdates() in a try/catch that discarded synchronous exceptions with zero logging - a silent failure point that could explain a chain's balances never syncing with no trace in logcat. Also add a full-architecture instrumented test that persists a real watch-only MetaAccount and polls AssetDao through the actual BalancesUpdateSystem pipeline, instead of bypassing it like the existing BalancesIntegrationTest does.
This commit is contained in:
+9
@@ -45,6 +45,11 @@ class BalancesUpdateSystem(
|
||||
}
|
||||
|
||||
private suspend fun balancesSync(chain: Chain, metaAccount: MetaAccount): Flow<Updater.SideEffect> {
|
||||
Log.d(
|
||||
"BalancesDiag",
|
||||
"balancesSync(${chain.name}): hasAccountIn=${metaAccount.hasAccountIn(chain)} " +
|
||||
"isDisabled=${chain.connectionState.isDisabled} canPerformFullSync=${chain.canPerformFullSync()}"
|
||||
)
|
||||
return when {
|
||||
!metaAccount.hasAccountIn(chain) -> emptyFlow()
|
||||
chain.connectionState.isDisabled -> emptyFlow()
|
||||
@@ -89,6 +94,10 @@ class BalancesUpdateSystem(
|
||||
try {
|
||||
updater.listenForUpdates(subscriptionBuilder, metaAccount).catch { logError(chain, it) }
|
||||
} catch (e: Exception) {
|
||||
// Was silently swallowed here with zero logging - listenForUpdates() itself is a suspend
|
||||
// call that can throw synchronously (e.g. FullSyncPaymentUpdater.listenForUpdates() calling
|
||||
// requireAccountIdIn(chain)), before ever returning a flow for the .catch{} above to guard.
|
||||
Log.e("BalancesDiag", "listenForUpdates() threw synchronously for ${updater.javaClass.simpleName} in ${chain.name}", e)
|
||||
emptyFlow()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user