fix: sentry + re-enable expo-updates + disable debug

This commit is contained in:
devthejo 2025-06-27 09:21:26 +02:00
parent e6924ac9ff
commit 8e8e120391
3 changed files with 10 additions and 9 deletions

View file

@ -10,8 +10,7 @@ let config = {
version, version,
updates: { updates: {
url: "https://expo-updates.alertesecours.fr/api/manifest?project=alerte-secours&channel=release", url: "https://expo-updates.alertesecours.fr/api/manifest?project=alerte-secours&channel=release",
// enabled: true, enabled: true,
enabled: false, // DEBUGGING
checkAutomatically: "ON_ERROR_RECOVERY", checkAutomatically: "ON_ERROR_RECOVERY",
fallbackToCacheTimeout: 0, fallbackToCacheTimeout: 0,
codeSigningCertificate: "./keys/certificate.pem", codeSigningCertificate: "./keys/certificate.pem",

View file

@ -32,8 +32,7 @@ registerRootComponent(App);
// Constants for persistence // Constants for persistence
const LAST_SYNC_TIME_KEY = "@geolocation_last_sync_time"; 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 = 24 * 60 * 60 * 1000;
const FORCE_SYNC_INTERVAL = 60 * 1000; // DEBUGGING
// Helper functions for persisting sync time // Helper functions for persisting sync time
const getLastSyncTime = async () => { const getLastSyncTime = async () => {

View file

@ -5,6 +5,7 @@ import { BACKGROUND_SCOPES } from "~/lib/logger/scopes";
import jwtDecode from "jwt-decode"; import jwtDecode from "jwt-decode";
import { initEmulatorMode } from "./emulatorService"; import { initEmulatorMode } from "./emulatorService";
import * as Sentry from "@sentry/react-native"; import * as Sentry from "@sentry/react-native";
import { SPAN_STATUS_OK, SPAN_STATUS_ERROR } from "@sentry/react-native";
import throttle from "lodash.throttle"; import throttle from "lodash.throttle";
@ -33,7 +34,7 @@ const config = {
locationAuthorizationRequest: "Always", locationAuthorizationRequest: "Always",
stopOnTerminate: false, stopOnTerminate: false,
startOnBoot: true, startOnBoot: true,
heartbeatInterval: 60, // DEBUGGING heartbeatInterval: 900,
// Force the plugin to start aggressively // Force the plugin to start aggressively
foregroundService: true, foregroundService: true,
notification: { notification: {
@ -372,7 +373,7 @@ export default async function trackLocation() {
}, },
}); });
span.setStatus("ok"); span.setStatus({ code: SPAN_STATUS_OK, message: "ok" });
} else { } else {
Sentry.addBreadcrumb({ Sentry.addBreadcrumb({
message: "Forced sync skipped", message: "Forced sync skipped",
@ -383,8 +384,7 @@ export default async function trackLocation() {
isEnabled: state.enabled, isEnabled: state.enabled,
}, },
}); });
span.setStatus({ code: SPAN_STATUS_OK, message: "skipped" });
span.setStatus("cancelled");
} }
} catch (error) { } catch (error) {
locationLogger.error("Forced sync failed", { 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 throw error; // Re-throw to ensure span captures the error
} }
}, },