From 7b80cb4a8499f645c22e1a3a25da376e54c6aa1a Mon Sep 17 00:00:00 2001 From: Sebastien Flory Date: Fri, 13 Dec 2024 12:07:09 +0100 Subject: [PATCH] Fix: notion stuck trying to operate on a page no longer in our db (#9354) --- .../src/connectors/notion/temporal/activities.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/connectors/src/connectors/notion/temporal/activities.ts b/connectors/src/connectors/notion/temporal/activities.ts index 383122a3650a..ddbeca0a270c 100644 --- a/connectors/src/connectors/notion/temporal/activities.ts +++ b/connectors/src/connectors/notion/temporal/activities.ts @@ -1354,7 +1354,16 @@ export async function cacheBlockChildren({ }, }); - if (notionPageModel?.skipReason) { + if (!notionPageModel) { + logger.info("Skipping page not found in db."); + return { + nextCursor: null, + blocksWithChildren: [], + blocksCount: 0, + }; + } + + if (notionPageModel.skipReason) { logger.info( { skipReason: notionPageModel.skipReason }, "Skipping page with skip reason"