diff --git a/app.config.js b/app.config.js index 2a96e59..f70682c 100644 --- a/app.config.js +++ b/app.config.js @@ -10,8 +10,7 @@ let config = { version, updates: { url: "https://expo-updates.alertesecours.fr/api/manifest?project=alerte-secours&channel=release", - // enabled: true, - enabled: false, // DEBUGGING + enabled: true, checkAutomatically: "ON_ERROR_RECOVERY", fallbackToCacheTimeout: 0, codeSigningCertificate: "./keys/certificate.pem", diff --git a/index.js b/index.js index 5f59deb..8835994 100644 --- a/index.js +++ b/index.js @@ -32,8 +32,7 @@ registerRootComponent(App); // Constants for persistence const LAST_SYNC_TIME_KEY = "@geolocation_last_sync_time"; -// const FORCE_SYNC_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours in milliseconds -const FORCE_SYNC_INTERVAL = 60 * 1000; // DEBUGGING +const FORCE_SYNC_INTERVAL = 24 * 60 * 60 * 1000; // Helper functions for persisting sync time const getLastSyncTime = async () => { diff --git a/src/location/trackLocation.js b/src/location/trackLocation.js index 9eb62ce..0b70aef 100644 --- a/src/location/trackLocation.js +++ b/src/location/trackLocation.js @@ -5,6 +5,7 @@ import { BACKGROUND_SCOPES } from "~/lib/logger/scopes"; import jwtDecode from "jwt-decode"; import { initEmulatorMode } from "./emulatorService"; import * as Sentry from "@sentry/react-native"; +import { SPAN_STATUS_OK, SPAN_STATUS_ERROR } from "@sentry/react-native"; import throttle from "lodash.throttle"; @@ -33,7 +34,7 @@ const config = { locationAuthorizationRequest: "Always", stopOnTerminate: false, startOnBoot: true, - heartbeatInterval: 60, // DEBUGGING + heartbeatInterval: 900, // Force the plugin to start aggressively foregroundService: true, notification: { @@ -372,7 +373,7 @@ export default async function trackLocation() { }, }); - span.setStatus("ok"); + span.setStatus({ code: SPAN_STATUS_OK, message: "ok" }); } else { Sentry.addBreadcrumb({ message: "Forced sync skipped", @@ -383,8 +384,7 @@ export default async function trackLocation() { isEnabled: state.enabled, }, }); - - span.setStatus("cancelled"); + span.setStatus({ code: SPAN_STATUS_OK, message: "skipped" }); } } catch (error) { locationLogger.error("Forced sync failed", { @@ -402,7 +402,10 @@ export default async function trackLocation() { }, }); - span.setStatus("internal_error"); + span.setStatus({ + code: SPAN_STATUS_ERROR, + message: "internal_error", + }); throw error; // Re-throw to ensure span captures the error } },