The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix message/calendar channels stuck with null syncStageStartedAt (#17684)
neo77329a263516444
diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/utils/is-sync-stale.util.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/utils/is-sync-stale.util.tsindex 9f5cff68238..35c857cc9d8 100644--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/utils/is-sync-stale.util.ts+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/utils/is-sync-stale.util.ts@@ -4,7 +4,7 @@ import { CALENDAR_IMPORT_ONGOING_SYNC_TIMEOUT } from 'src/modules/calendar/calenexport const isSyncStale = (syncStageStartedAt?: string | null): boolean => {if (!isDefined(syncStageStartedAt)) {- return false;+ return true;}const syncStageStartedTime = new Date(syncStageStartedAt).getTime();diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/utils/__tests__/is-sync-stale.util.spec.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/utils/__tests__/is-sync-stale.util.spec.tsindex 07704739194..20e6e2ad6f2 100644--- a/packages/twenty-server/src/modules/messaging/message-import-manager/utils/__tests__/is-sync-stale.util.spec.ts+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/utils/__tests__/is-sync-stale.util.spec.ts@@ -24,16 +24,16 @@ describe('isSyncStale', () => {expect(result).toBe(false);});- it('should return false if syncStageStartedAt is undefined', () => {+ it('should return true if syncStageStartedAt is undefined', () => {const result = isSyncStale(undefined);- expect(result).toBe(false);+ expect(result).toBe(true);});- it('should return false if syncStageStartedAt is null', () => {+ it('should return true if syncStageStartedAt is null', () => {const result = isSyncStale(null);- expect(result).toBe(false);+ expect(result).toBe(true);});it('should throw an error if syncStageStartedAt is invalid', () => {diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/utils/is-sync-stale.util.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/utils/is-sync-stale.util.tsindex 45661f5dd6c..964c95f75da 100644--- a/packages/twenty-server/src/modules/messaging/message-import-manager/utils/is-sync-stale.util.ts+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/utils/is-sync-stale.util.ts@@ -4,7 +4,7 @@ import { MESSAGING_IMPORT_ONGOING_SYNC_TIMEOUT } from 'src/modules/messaging/mesexport const isSyncStale = (syncStageStartedAt?: string | null): boolean => {if (!isDefined(syncStageStartedAt)) {- return false;+ return true;}const syncStageStartedTime = new Date(syncStageStartedAt).getTime();