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:
2026-07-09 07:52:15 -07:00
parent b3714d3b79
commit 688a23ba6b
3 changed files with 120 additions and 1 deletions
@@ -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()
}
}