Earnings: provider Demand chart and Why? stay blank until the next minute poll

オープン
#487 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, kotlin
領域
mobile

調査の方向性

Start in the Earnings screen's onRefresh and in providerStatusDisplay(), which sets why = false when the snapshot is absent. Wire the existing vc.refresh() on ProviderStatusViewController into pull-to-refresh, then add a retry action to the chart's unavailable state. Done when pull-to-refresh re-polls provider status and a failed Demand chart can be retried without waiting for the next minute tick.

索引モデルが issue の本文から書いたものです。

説明

On Earnings, the provider stats block's Demand histogram often fails to load, and the expandable Why? under it disappears with it. It comes back only after several pull-to-refresh gestures (scroll to the top, drag down, scroll back to check), which makes the section feel broken.

Cause

The two panels are one state, not two bugs: providerStatusDisplay() sets why = false whenever the snapshot is absent, so the Why? goes with the chart.

That snapshot comes from the SDK's ProviderStatusViewController, which polls GET /network/provider-status once at start and then about once a minute. On a failed poll it retries at its next interval, not sooner (step() stamps nextPollAt when it launches the fetch).

The Earnings pull-to-refresh does not touch that controller. Its onRefresh refreshes account points, wallet, epochs, claims, settlements and consent — not provider status. So the gesture cannot affect this section, and the apparent "recovery" is the next 60-second tick landing while the user is scrolling.

ProviderStatusViewController.Refresh() exists (cgo urn_provider_status_view_controller_refresh, Kotlin vc.refresh()) but nothing in the app calls it.

Two things make that first poll fail more often than it should:

  • The chart's unavailable state has no action, so there is no way to ask again before the interval.
  • GET /network/provider-status answers 503 Cached response is temporarily unavailable. with Retry-After: 5 to concurrent or post-failure callers while a cache fill lease is held, and the SDK ignores the hint. Admission and ranking are also cached for 5 minutes.

Suggested fix

  1. Call vc.refresh() from the screen's pull-to-refresh, and offer a retry in the chart's unavailable state — ideally only where asking again can change the answer (a failed poll or a missing histogram, not "this device is not a provider client", which the server caches for minutes).
  2. Optionally, retry a failed first poll after a few seconds, bounded, instead of waiting the full interval.

Repro

Providing enabled (provide mode not Never) → open Earnings → scroll to Provider statistics. With a brief network interruption around app start, the Demand chart shows "Provider status isn't available right now", the Why? is absent, pull-to-refresh does nothing, and the section recovers on its own about a minute later.

The iOS client has the same limitation

Checked against urnetwork/apple main. It is not a platform difference — the same shape is there:

  • ProviderStatusPresentation.swift returns showsWhy: false when the snapshot is not loaded or has no row for the device, so the Why? goes with the chart exactly as on Android.
  • EarningsView.swift .refreshable { await refresh() } refreshes the wallet, epochs and subnet, not the provider status.
  • The ProviderStatusControlling protocol in ProviderStatusStore.swift exposes only start, stop, addStatusListener and readSnapshot — no force-poll at all, so a fix there needs a refresh() added to the protocol or a controller restart to force the poll.
主要言語
Kotlin
スター
224
フォーク
14
平均マージ
55分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

urnetwork/android のほかの issue

urnetwork/android の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。