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
{{ message }}
Repository navigation
portfolio-v2: a token/metrics upstream failure discards engine balances that were already fetched #65
In FetchEngineTokensWithBalance (Handlers/WalletApi.Engine.cs) the balances call succeeds first, then FetchEngineTokens and FetchEngineMetrics run together:
If either tokensTask or metricsTask throws after exhausting failover, the outer catch returns an empty array and the entire engine layer disappears — including balances that were already fetched successfully.
metrics — market data, used only for fiat valuation.
A metrics outage currently produces the same user-visible result as a total Hive-Engine outage: no tokens in the wallet at all. Degrading to "balances without a fiat value" is strictly better than showing nothing.
The rewards leg already models this correctly — it is capped by EngineRewardsTimeoutMs and degrades to an empty array rather than failing the layer. Tokens and metrics should degrade the same way.
Proposed fix
Give tokensTask and metricsTask the same treatment as rewards: fall back to an empty array on failure so ConvertEngineToken receives nulls for the optional inputs, and the balance rows still render. Keep the outer catch for the balances call, which is the only genuinely required leg.
Add a test covering: balances succeed, metrics fail -> engine layer still returns one row per balance.
Not the cause of the currently-reported missing balances (see the metadata-node issue), but it is the remaining path where good data is thrown away because an optional enrichment failed.
Activity