diff --git a/services/tasks/src/queues/background-geolocation-lost-notify.js b/services/tasks/src/queues/background-geolocation-lost-notify.js index bc7e7bb..a710670 100644 --- a/services/tasks/src/queues/background-geolocation-lost-notify.js +++ b/services/tasks/src/queues/background-geolocation-lost-notify.js @@ -9,8 +9,8 @@ function createBackgroundGeolocationLostNotification() { action: "background-geolocation-lost", }, notification: { - title: `Alerte-Secours ne peut plus accéder à votre position`, - body: `Vous ne pouvez plus recevoir d'alertes de proximité. Vérifiez les paramètres.`, + title: `Alerte-Secours ne reçoit plus de mises à jour de votre position`, + body: `Vous ne pourrez plus recevoir d'alertes de proximité. Vérifiez les paramètres.`, channel: "system", priority: "high", actionId: "open-background-geolocation-settings", diff --git a/services/tasks/src/queues/ios-geolocation-heartbeat-sync.js b/services/tasks/src/queues/ios-geolocation-heartbeat-sync.js.bak similarity index 100% rename from services/tasks/src/queues/ios-geolocation-heartbeat-sync.js rename to services/tasks/src/queues/ios-geolocation-heartbeat-sync.js.bak diff --git a/services/watchers/src/constants/time.js b/services/watchers/src/constants/time.js index 1d34f82..cba9377 100644 --- a/services/watchers/src/constants/time.js +++ b/services/watchers/src/constants/time.js @@ -8,9 +8,9 @@ module.exports = { SCAN_AUTO_CLOSE_CRON: "15 * * * *", // At minute 15 SCAN_AUTO_ARCHIVE_CRON: "0 4 * * *", // At 4:00 RELATIVE_UNREGISTERED_RECONCILIATION_CRON: "0 4 * * *", // At 4:00 - DEVICE_GEODATA_IOS_SILENT_PUSH_AGE: "24 hours", // When to send iOS silent push for heartbeat sync - DEVICE_GEODATA_NOTIFICATION_AGE: "48 hours", // When to send push notification - DEVICE_GEODATA_CLEANUP_AGE: "2 weeks", // When to remove/clean data + // DEVICE_GEODATA_IOS_SILENT_PUSH_AGE: "24 hours", // When to send iOS silent push for heartbeat sync + DEVICE_GEODATA_NOTIFICATION_AGE: "14 days", // When to send push notification + DEVICE_GEODATA_CLEANUP_AGE: "15 days", // When to remove/clean data } // cheat on https://crontab.guru/ diff --git a/services/watchers/src/tasks/index.js b/services/watchers/src/tasks/index.js index 8305094..a837658 100644 --- a/services/watchers/src/tasks/index.js +++ b/services/watchers/src/tasks/index.js @@ -10,5 +10,5 @@ module.exports = { RELATIVE_INVITATION_NOTIFY: "relativeInvitationNotify", ALERT_CALL_EMERGENCY_INFO_NOTIFY: "alertCallEmergencyInfoNotify", BACKGROUND_GEOLOCATION_LOST_NOTIFY: "backgroundGeolocationLostNotify", - IOS_GEOLOCATION_HEARTBEAT_SYNC: "iosGeolocationHeartbeatSync", + // IOS_GEOLOCATION_HEARTBEAT_SYNC: "iosGeolocationHeartbeatSync", } diff --git a/services/watchers/src/watchers/geodata-cleanup-cron.js b/services/watchers/src/watchers/geodata-cleanup-cron.js index 8a40716..018e91b 100644 --- a/services/watchers/src/watchers/geodata-cleanup-cron.js +++ b/services/watchers/src/watchers/geodata-cleanup-cron.js @@ -3,7 +3,7 @@ const { ctx } = require("@modjo/core") const ms = require("ms") const cron = require("~/libs/cron") const { - DEVICE_GEODATA_IOS_SILENT_PUSH_AGE, + // DEVICE_GEODATA_IOS_SILENT_PUSH_AGE, DEVICE_GEODATA_NOTIFICATION_AGE, DEVICE_GEODATA_CLEANUP_AGE, } = require("~/constants/time") @@ -15,9 +15,7 @@ const COLDGEODATA_DEVICE_KEY_PREFIX = "device:geodata:" const COLDGEODATA_OLD_KEY_PREFIX = "old:device:geodata:" const COLDGEODATA_NOTIFIED_KEY_PREFIX = "notified:device:geodata:" const HOTGEODATA_KEY = "device" // The key where hot geodata is stored -const iosHeartbeatAge = Math.floor( - ms(DEVICE_GEODATA_IOS_SILENT_PUSH_AGE) / 1000 -) // Convert to seconds +// const iosHeartbeatAge = Math.floor(ms(DEVICE_GEODATA_IOS_SILENT_PUSH_AGE) / 1000) const notificationAge = Math.floor(ms(DEVICE_GEODATA_NOTIFICATION_AGE) / 1000) // Convert to seconds const cleanupAge = Math.floor(ms(DEVICE_GEODATA_CLEANUP_AGE) / 1000) // Convert to seconds @@ -93,22 +91,22 @@ module.exports = async function () { "Error cleaning device data" ) } - } else if (age > iosHeartbeatAge) { - try { - await addTask(tasks.IOS_GEOLOCATION_HEARTBEAT_SYNC, { - deviceId, - }) + // } else if (age > iosHeartbeatAge) { + // try { + // await addTask(tasks.IOS_GEOLOCATION_HEARTBEAT_SYNC, { + // deviceId, + // }) - logger.info( - { deviceId, age: `${Math.floor(age / 3600)}h` }, - "Enqueued iOS geolocation heartbeat sync task" - ) - } catch (heartbeatError) { - logger.error( - { deviceId, error: heartbeatError }, - "Error enqueueing iOS geolocation heartbeat sync task" - ) - } + // logger.info( + // { deviceId, age: `${Math.floor(age / 3600)}h` }, + // "Enqueued iOS geolocation heartbeat sync task" + // ) + // } catch (heartbeatError) { + // logger.error( + // { deviceId, error: heartbeatError }, + // "Error enqueueing iOS geolocation heartbeat sync task" + // ) + // } } else if (age > notificationAge) { const notifiedKey = `${COLDGEODATA_NOTIFIED_KEY_PREFIX}${deviceId}`