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

View file

@ -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 () => {

View file

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