fix: sentry + re-enable expo-updates + disable debug
This commit is contained in:
parent
e6924ac9ff
commit
8e8e120391
3 changed files with 10 additions and 9 deletions
|
@ -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",
|
||||
|
|
3
index.js
3
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 () => {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue