Skip to content

fix(stats): one polling controller for the overview screens (#1570) - #1713

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
perf/shared-polling-controller
Oct 18, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
perf/shared-polling-controller

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1570

The five overview/stats screens (PostgreSQL, MySQL, Redis, MongoDB, extension drivers) each had a copy of Timer.periodic + catch (_) {}.

  • PollingController (core/motion/polling_controller.dart): the next tick is scheduled when the previous one finished, so at most one request is in flight and samples land in order. A failed tick doubles the wait (capped at 1 min), the first success returns to the normal interval. status (ValueListenable<PollStatus>) carries the last success time and the failure count.
  • PollingState mixin: starts/stops polling from didChangeDependencies (TickerMode) and from the places that change whether there is data to refresh (load finished/failed, interval picked), no longer from build.
  • PollStaleOverlay: a small "Updates failed · showing HH:MM:SS" note in the corner while the latest poll failed; the dashboard keeps the last good numbers, but no longer looks live.
  • ticker_gated_polling.dart and its test are removed (no users left).

Tests: no overlap with a slow tick, backoff/cap/recovery, a stop during a running tick, interval change, TickerMode gating, dispose, the note.

… request at a time, backoff on errors, a note when the numbers are stale (#1570)
@github-actions github-actions Bot added bug Something isn't working frontend Theme parser epic label: frontend stability Theme parser epic label: stability P2 Medium priority / Parity & Refactoring labels Oct 18, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 1cd1b5e into dev Oct 18, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Theme parser epic label: frontend P2 Medium priority / Parity & Refactoring stability Theme parser epic label: stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant