From b467cb7532243fd028e9d81e5d9677e2bbb39ec3 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 5 Jun 2026 12:06:22 -0400 Subject: [PATCH] refactor(android): unify offline detection into NetworkStatusController Absorbs VersionCheckController (/healthz poll + version parse) and ServerHealthController (tri-state derive) into one signal-driven authority. Adds the non-gating Unstable state across all ServerHealth branch sites (OfflineGatedDataSource, SearchRepository, TrackRow, banner). Repoints MinstrelApplication, MainActivity, PlayerFactory, VersionTooOldViewModel. Drops the now-unused nowMs params the detekt UnusedParameter rule flagged. Co-Authored-By: Claude Opus 4.8 (1M context) --- android/.idea/caches/deviceStreaming.xml | 13 + android/.idea/misc.xml | 1 - .../6.json | 690 ++++++++++++++++++ .../com/fabledsword/minstrel/MainActivity.kt | 6 +- .../minstrel/MinstrelApplication.kt | 23 +- .../connectivity/ConnectivityObserver.kt | 2 +- .../connectivity/NetworkStatusController.kt | 173 +++++ .../connectivity/ReachabilityMachine.kt | 4 +- .../connectivity/ServerHealthController.kt | 75 -- .../connectivity/ui/ConnectionErrorBanner.kt | 7 +- .../minstrel/player/OfflineGatedDataSource.kt | 11 +- .../minstrel/player/PlayerFactory.kt | 2 +- .../minstrel/search/data/SearchRepository.kt | 11 +- .../minstrel/shared/widgets/TrackRow.kt | 7 +- .../minstrel/update/api/HealthzApi.kt | 4 +- .../update/data/VersionCheckController.kt | 112 --- .../minstrel/update/data/VersionResult.kt | 8 + .../update/ui/VersionTooOldViewModel.kt | 8 +- .../connectivity/ReachabilityMachineTest.kt | 34 +- 19 files changed, 942 insertions(+), 249 deletions(-) create mode 100644 android/app/schemas/com.fabledsword.minstrel.cache.db.AppDatabase/6.json create mode 100644 android/app/src/main/java/com/fabledsword/minstrel/connectivity/NetworkStatusController.kt delete mode 100644 android/app/src/main/java/com/fabledsword/minstrel/connectivity/ServerHealthController.kt delete mode 100644 android/app/src/main/java/com/fabledsword/minstrel/update/data/VersionCheckController.kt create mode 100644 android/app/src/main/java/com/fabledsword/minstrel/update/data/VersionResult.kt diff --git a/android/.idea/caches/deviceStreaming.xml b/android/.idea/caches/deviceStreaming.xml index d469d46c..5dc2fb2b 100644 --- a/android/.idea/caches/deviceStreaming.xml +++ b/android/.idea/caches/deviceStreaming.xml @@ -1754,6 +1754,19 @@