diff --git a/android/app/src/main/kotlin/dev/fiatcode/tracpulse/service/LocationTrackingService.kt b/android/app/src/main/kotlin/dev/fiatcode/tracpulse/service/LocationTrackingService.kt index b7f690f..8f6dbe3 100644 --- a/android/app/src/main/kotlin/dev/fiatcode/tracpulse/service/LocationTrackingService.kt +++ b/android/app/src/main/kotlin/dev/fiatcode/tracpulse/service/LocationTrackingService.kt @@ -79,7 +79,6 @@ class LocationTrackingService : Service() { connectivityReceiver = ConnectivityReceiver { online -> isNetworkAvailable = online logEvent("NETWORK_CHANGE", "Network: ${if (online) "online" else "offline"}") - if (online) syncBufferedLocations() } val intentFilter = IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION) @@ -389,6 +388,8 @@ class LocationTrackingService : Service() { logEvent("ERROR", "Failed to send location: ${result.exceptionOrNull()?.message}") bufferLocation(location) } + // Also try to flush any buffered locations after each send attempt + syncBufferedLocations() } }