From 4810a23b11b543081633cb9b2e8a7c2ef390b9f5 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Thu, 15 Jan 2026 10:58:38 +0700 Subject: [PATCH] fix: guard against stale geocoding results on legacy devices - Add isActive check after blocking Geocoder.getFromLocation call - Prevent stale results from overwriting state after job cancellation --- .../java/com/bitchat/android/geohash/LocationChannelManager.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/bitchat/android/geohash/LocationChannelManager.kt b/app/src/main/java/com/bitchat/android/geohash/LocationChannelManager.kt index ab484ae6..e330a1aa 100644 --- a/app/src/main/java/com/bitchat/android/geohash/LocationChannelManager.kt +++ b/app/src/main/java/com/bitchat/android/geohash/LocationChannelManager.kt @@ -592,6 +592,8 @@ class LocationChannelManager private constructor(private val context: Context) { @Suppress("DEPRECATION") val addresses = geocoder.getFromLocation(location.latitude, location.longitude, 1) + if (!isActive) return@launch + if (!addresses.isNullOrEmpty()) { val address = addresses[0] val names = namesByLevel(address)