fix: prevent race condition

This commit is contained in:
devthejo 2025-06-29 12:39:07 +02:00
parent 70cca596e4
commit 6a773367d4

View file

@ -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,