refactor: fetch speed test servers on-demand instead of polling#709
Conversation
Remove GetCloseHealthCheckServers from core transaction to reduce polling payload. Server list is now fetched on-demand when entering the speed test view. Added loading spinner, error state with retry button, and differentiated error vs empty server list for proper legacy fallback behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review Summary by QodoFetch speed test servers on-demand with loading and error states
WalkthroughsDescription• Remove polling overhead by fetching speed test servers on-demand • Add loading spinner and error handling with retry capability • Differentiate server fetch errors from empty lists for proper fallback • Disable GO button during server fetch to prevent premature test start Diagramflowchart LR
A["Polling Provider"] -->|Remove GetCloseHealthCheckServers| B["Reduced Polling Payload"]
C["Speed Test View"] -->|On-demand fetch| D["Health Check Provider"]
D -->|fetchRemote: true| E["Router Repository"]
E -->|Success| F["Display Servers Dropdown"]
E -->|Error| G["Show Error + Retry Button"]
E -->|Empty| H["Legacy Fallback"]
I["Loading State"] -->|Disable GO Button| J["Prevent Premature Test"]
File Changes1. lib/core/jnap/providers/polling_provider.dart
|
Code Review by Qodo
1.
|
- Fix copyWith unable to clear selectedServer to null by adding clearSelectedServer flag parameter - Add speedTestFailedToLoadServers translations to all 25 locale .arb files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Addressed Qodo Review (6b939e0)1. Cannot clear selected server (Bug)Added 2. Missing locale translations (Bug)Added |
Summary
GetCloseHealthCheckServersfrom core transaction to reduce polling payload overheadupdateServers()now fetches directly from router (fetchRemote: true) on-demand when entering the speed test viewCloses #713
Test plan
GetCloseHealthCheckServers🤖 Generated with Claude Code