Compare commits

..

No commits in common. "6a773367d49ef66a8a896ba18e63c660f30eb143" and "010aa2c2fc0cf80c6afd3eb4fe954f94c94b8bea" have entirely different histories.

2 changed files with 2 additions and 9 deletions

View file

@ -204,10 +204,10 @@ export default async function trackLocation() {
// Create throttled version of auth reload with lodash // Create throttled version of auth reload with lodash
const reloadAuth = throttle(_reloadAuth, AUTH_RELOAD_THROTTLE, { const reloadAuth = throttle(_reloadAuth, AUTH_RELOAD_THROTTLE, {
leading: true, leading: true,
trailing: false, // Prevent trailing calls to avoid duplicate refreshes trailing: true,
}); });
BackgroundGeolocation.onHttp(async (response) => { BackgroundGeolocation.onHttp((response) => {
// Log the full response including headers if available // Log the full response including headers if available
locationLogger.debug("HTTP response received", { locationLogger.debug("HTTP response received", {
status: response?.status, status: response?.status,

View file

@ -153,7 +153,6 @@ export default createAtom(({ get, merge, getActions }) => {
} }
if (isLoading()) { if (isLoading()) {
authLogger.info("Auth is already loading, waiting for completion");
await loadingPromise; await loadingPromise;
return true; return true;
} }
@ -163,15 +162,9 @@ export default createAtom(({ get, merge, getActions }) => {
try { try {
startLoading(); startLoading();
authLogger.debug("Deleting userToken for refresh");
await secureStore.deleteItemAsync("userToken"); await secureStore.deleteItemAsync("userToken");
await init(); await init();
return true; return true;
} catch (error) {
authLogger.error("Auth reload failed", { error: error.message });
throw error;
} finally { } finally {
// Clear reloading state even if there was an error // Clear reloading state even if there was an error
merge({ isReloading: false }); merge({ isReloading: false });