chahinebrini 63fae25531 fix(android-protection): explicit specialUse FGS type — Samsung/Android 16 crash loop
RebreakVpnService.onStartCommand crashed with SecurityException because Android 16's validateForegroundServiceType rejects the implicit 2-arg startForeground(). Now passes FOREGROUND_SERVICE_TYPE_SPECIAL_USE explicitly (Google's documented best practice) and guards the call so a failed foreground promotion stops the service cleanly instead of crashing the app. Verified vs reported Galaxy A54 / Android 16 signature (97% of crash events, 1-user crash loop).

Bundles pending working-tree work across native/marketing/locales/mac + graphify-out rebuild. gitignore: google-services.json + /screenshots/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 22:33:28 +02:00

20 lines
899 B
TypeScript

import { AppState } from "react-native";
/**
* Realtime-WebSocket-Closes beim Backgrounden sind ERWARTET, kein echter Fehler:
* Supabase schließt den Socket via `auth.stopAutoRefresh()` (Close-Code 1000 =
* „Normal Closure"), sobald die App in den Hintergrund geht — das feuert
* CHANNEL_ERROR/TIMED_OUT gleichzeitig auf ALLEN Channels (call-ring, notif,
* approval, domain …). Re-Subscribe passiert beim Foreground automatisch über
* den jeweiligen Reconnect-Timer.
*
* Nur im Vordergrund ist ein CHANNEL_ERROR ein echtes Problem, das geloggt
* werden soll. Im Hintergrund würde das Logging nur Spam erzeugen.
*
* (Backyard-Infra-Diagnose 2026-06-10: nginx-WS-Proxy korrekt, Realtime-Container
* gesund, nginx-Error-Log leer — der Close ist rein client-seitig + erwartet.)
*/
export function isRealtimeErrorReal(): boolean {
return AppState.currentState === "active";
}