From c2f521db1e5f261c81141683eaafff26e6f080cb Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 19 Dec 2024 12:52:26 -0500 Subject: [PATCH] dev: fix a timestamp bug in old name expiry --- src/backend/src/services/OldAppNameService.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/backend/src/services/OldAppNameService.js b/src/backend/src/services/OldAppNameService.js index 138488b9..d838a98c 100644 --- a/src/backend/src/services/OldAppNameService.js +++ b/src/backend/src/services/OldAppNameService.js @@ -29,11 +29,20 @@ class OldAppNameService extends BaseService { // Check if the app has been renamed in the last N months const [row] = rows; - const timestamp = new Date(row.timestamp); + const timestamp = new Date( + // Ensure timestamp ir processed as UTC + row.timestamp.endsWith('Z') ? row.timestamp : row.timestamp + 'Z' + ); const age = Date.now() - timestamp.getTime(); - const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000 + const n_ms = 60 * 1000; + // const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000 + this.log.noticeme('AGE INFO', { + input_time: row.timestamp, + age, + n_ms, + }); if ( age > n_ms ) { // Remove record await this.db.write(