mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 14:55:48 +00:00
fix: NativeAssetBalance uses typed subscribe DSL, not raw key subscription
Root cause found via 4 rounds of CI diagnostics: HEZ (native asset) on
Pezkuwi Asset Hub was correctly present+enabled in the Chain domain model,
correctly dispatched to NativeAssetBalance, and its System.Account storage
key was correctly computed - but the raw subscriptionBuilder.subscribe(key)
call never actually reached the RPC connection, with zero exceptions and
zero data, while the chain's 5 other assets (all statemine-type, all using
the same SharedRequestsBuilder) synced fine. The same NativeAssetBalance
code worked correctly for every OTHER native asset on every OTHER chain
tested, ruling out a generic bug in the class.
Switched startSyncingBalance() to the typed remoteStorage.subscribe { }
DSL (metadata.system.account.observeWithRaw) - the same mechanism this
class's own subscribeAccountBalanceUpdatePoint() and PooledBalanceUpdater/
BalanceLocksUpdater already use successfully on the same busy chain
connection, instead of the raw subscriptionBuilder.subscribe(key) call
that appears to silently drop registration in that specific configuration.
Also removes the diagnostic logging added during the investigation
(BalancesUpdateSystem's per-chain balancesSync trace, FullSyncPaymentUpdater's
per-chain asset dump) - kept the one genuinely valuable permanent addition,
the "listenForUpdates() threw synchronously" error log for a previously
silent failure mode.
This commit is contained in:
+5
-5
@@ -29,9 +29,9 @@ import kotlin.time.Duration.Companion.seconds
|
||||
* Activity, so we collect it ourselves here via the same AssetsFeatureApi.updateSystem instance the real app
|
||||
* uses, instead of relying on app UI lifecycle to start it.
|
||||
*
|
||||
* If this test fails, the failure message + logcat (tag "BalancesDiag", plus the standard per-updater error
|
||||
* logs already wired into BalancesUpdateSystem/FullSyncPaymentUpdater) shows exactly which decision branch or
|
||||
* exception is responsible - not another layer of inference from silence.
|
||||
* If this test fails, the standard per-updater error logs already wired into BalancesUpdateSystem/
|
||||
* FullSyncPaymentUpdater/NativeAssetBalance show exactly which decision branch or exception is responsible -
|
||||
* not another layer of inference from silence.
|
||||
*/
|
||||
class PezkuwiFullArchitectureBalancesTest {
|
||||
|
||||
@@ -69,8 +69,8 @@ class PezkuwiFullArchitectureBalancesTest {
|
||||
|
||||
assertNotNull(
|
||||
"No `assets` row was ever written for HEZ on Pezkuwi Asset Hub (metaId=$metaId) within 90s. " +
|
||||
"The real BalancesUpdateSystem pipeline never completed a sync for this asset - check logcat " +
|
||||
"tag 'BalancesDiag' and the standard FullSyncPaymentUpdater/StatemineAssetBalance error logs.",
|
||||
"The real BalancesUpdateSystem pipeline never completed a sync for this asset - check the " +
|
||||
"standard FullSyncPaymentUpdater/NativeAssetBalance error logs in logcat.",
|
||||
assetRow
|
||||
)
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user