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

Đang mở
#487 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Kotlin
Star
224
Fork
14
Merge trung bình
55 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của urnetwork/android

Tất cả issue của urnetwork/android

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.