fix(android): don't flip offline on WAN-validation flicker — trust /healthz #85
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Same-day re-cut on the per-day mutable CalVer scheme (post-v2026.06.04 papercut #2).
False "server offline" → playback "Source error" on a healthy LAN server
On-device: the app reported the server offline while it wasn't, a track failed with
load_failed/ "Source error", then recovered on its own.Root cause (proven from the code):
ConnectivityObserver.onlinegated onNET_CAPABILITY_VALIDATED. That capability tracks whether Android reached its own WAN internet-validation probe (Google'sgenerate_204) — not whether the self-hosted Minstrel server is reachable. The server is usually on the LAN.VALIDATEDwhile the LAN server stays reachable. (logcat around the incident showsERR_NAME_NOT_RESOLVED+ Wi-Fi capability churn.)ServerHealthControllerflips toOfflinethe instantonlinegoes false — no debounce. The/healthzhysteresis added earlier today only guards the ServerDown path.OfflineGatedDataSource.open()then throwsOfflineExceptionon the in-flight stream read → ExoPlayer SOURCE error →PlaybackErrorReporter→ theload_failedevent.Fix:
ConnectivityObserver— requireINTERNETonly, notVALIDATED. The device-link signal now answers only "is there a network at all" (airplane mode); the/healthzpoll (VersionCheckController, with its own failure hysteresis) is the authority on whether Minstrel is reachable. A WAN-validation flicker with a healthy LAN no longer reads as offline.ServerHealthController— add a WARN-tierServerHealth -> Xtransition log. The signal had zero instrumentation, which is why this was hard to diagnose from logcat.Verify on device
adb logcat -s Minstrelduring a Wi-Fi/WAN hiccup:ServerHealthshould stayHealthy(or goServerDownonly after sustained/healthzfailures), never flip toOfflinefrom a brief validation drop. Playback of a streaming (non-cached) track no longer dies with "Source error" on a momentary blip.🤖 Generated with Claude Code