feat(offline): #427 S1 — reachability offline marker
offlineProvider: a Notifier<bool> driven by a periodic /healthz probe. Offline after N=3 consecutive failed probes; recovers on the first success. Slow heartbeat when online (30s), faster when offline (10s) so recovery is noticed quickly. 5s initial delay for provider warmup; optimistic (false) until proven otherwise. Deliberately NOT coupled to connectivityProvider — subscribing to that StreamProvider eagerly mounts its 2s timeout and leaks a pending Timer through widget tests (the MutationReplayer bug). /healthz failing already covers interface-down. No .timeout() wrapper either (dio's own timeouts bound the probe) so the only Timers are the tracked initial+periodic, both cancelled via ref.onDispose — the proven smoke-safe shape. Wired in app.dart postFrame to start the poller. No UI yet; S4 gates system-playlist play + Shuffle-all on it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'cache/cache_filler.dart';
|
||||
import 'cache/metadata_prefetcher.dart';
|
||||
import 'cache/offline_provider.dart';
|
||||
import 'cache/mutation_queue.dart';
|
||||
import 'cache/prefetcher.dart';
|
||||
import 'cache/sync_controller.dart';
|
||||
@@ -61,6 +62,10 @@ class _MinstrelAppState extends ConsumerState<MinstrelApp> {
|
||||
// scoring, scrobbles, and system-playlist rotation, and is the
|
||||
// path that carries the `source` tag for #415.
|
||||
ref.read(playEventsReporterProvider);
|
||||
// Offline marker (#427 S1): periodic /healthz reachability
|
||||
// probe → offlineProvider. Read here to start the poller; S4
|
||||
// gates system-playlist play + Shuffle-all on it.
|
||||
ref.read(offlineProvider);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user