mirror of
https://github.com/screentinker/screentinker.git
synced 2026-05-15 07:32:23 -06:00
Every Socket.IO listener now goes through a safeOn helper that wraps the body in try/catch(Throwable). Unsafe args[0] as JSONObject and data.getString() patterns replaced with firstOrNull as? JSONObject and optString — a malformed payload from the server, or a transient state error during disconnect, no longer surfaces as an unhandled exception on the IO thread. Reconnection now uses explicit exponential backoff with jitter (1s → 60s, randomizationFactor 0.5) so a fleet doesn't reconnect in lockstep after a server blip. EVENT_DISCONNECT stops the heartbeat while disconnected; the player keeps showing cached content. register, sendHeartbeat, requestPlaylistRefresh, sendScreenshot, sendContentAck, sendPlaybackState, and disconnect are all wrapped — telemetry / WiFi service calls can throw on some devices. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src/main | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||