From 024c4369de4175824b9e0c174f7a4494d52fb389 Mon Sep 17 00:00:00 2001 From: Henry Fontanier Date: Wed, 11 Dec 2024 17:36:07 +0100 Subject: [PATCH] add to updateParents --- connectors/src/connectors/notion/lib/parents.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/connectors/src/connectors/notion/lib/parents.ts b/connectors/src/connectors/notion/lib/parents.ts index 6e317f4b857e..92b952491a2f 100644 --- a/connectors/src/connectors/notion/lib/parents.ts +++ b/connectors/src/connectors/notion/lib/parents.ts @@ -155,13 +155,18 @@ export async function updateAllParentsFields( for (const pageId of pageIdsToUpdate) { promises.push( q.add(async () => { - const parents = await getParents( + const pageOrDbIds = await getParents( connectorId, pageId, [], memoizationKey, onProgress ); + + // TODO(kw_search) remove legacy + const legacyParents = pageOrDbIds; + const parents = pageOrDbIds.map((id) => `notion-${id}`); + logger.info( { connectorId, @@ -172,7 +177,7 @@ export async function updateAllParentsFields( await updateDocumentParentsField({ dataSourceConfig: dataSourceConfigFromConnector(connector), documentId: `notion-${pageId}`, - parents, + parents: [...parents, ...legacyParents], }); if (onProgress) { await onProgress();