From 6a773367d49ef66a8a896ba18e63c660f30eb143 Mon Sep 17 00:00:00 2001 From: devthejo Date: Sun, 29 Jun 2025 12:39:07 +0200 Subject: [PATCH] fix: prevent race condition --- src/location/trackLocation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/location/trackLocation.js b/src/location/trackLocation.js index 1328817..e2c7331 100644 --- a/src/location/trackLocation.js +++ b/src/location/trackLocation.js @@ -204,10 +204,10 @@ export default async function trackLocation() { // Create throttled version of auth reload with lodash const reloadAuth = throttle(_reloadAuth, AUTH_RELOAD_THROTTLE, { leading: true, - trailing: true, + trailing: false, // Prevent trailing calls to avoid duplicate refreshes }); - BackgroundGeolocation.onHttp((response) => { + BackgroundGeolocation.onHttp(async (response) => { // Log the full response including headers if available locationLogger.debug("HTTP response received", { status: response?.status,