From 78b40dbddc3a846b9b131626604ba12cf54a333f Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 13 Jul 2023 10:56:34 +0800 Subject: [PATCH] fix date comparison --- packages/rss-handler/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rss-handler/src/index.ts b/packages/rss-handler/src/index.ts index 4e1ffdd2b..2b00025dd 100644 --- a/packages/rss-handler/src/index.ts +++ b/packages/rss-handler/src/index.ts @@ -10,7 +10,7 @@ interface RssFeedRequest { subscriptionId: string userId: string feedUrl: string - lastFetchedAt: Date + lastFetchedAt: string } function isRssFeedRequest(body: any): body is RssFeedRequest { @@ -122,7 +122,7 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction( continue } - if (new Date(publishedAt) <= lastFetchedAt) { + if (new Date(publishedAt) <= new Date(lastFetchedAt)) { console.log('Skipping old feed item', item.link) continue }