Skip to content

Commit

Permalink
[Nodes Core] Remove irrelevant type diff for google spreadsheets (#10420
Browse files Browse the repository at this point in the history
)
  • Loading branch information
philipperolet authored Jan 31, 2025
1 parent e3faa43 commit 8fbe6e8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions front/lib/api/content_nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export function computeNodesDiff({
return false;
}
// Custom exclusion rules. The goal here is to avoid logging irrelevant differences, scoping by connector.

// For Snowflake and Zendesk we fixed how parents were computed in the core folders but not in connectors.
// For Intercom we keep the virtual node Help Center in connectors but not in core.
if (
Expand All @@ -121,6 +122,7 @@ export function computeNodesDiff({
return false;
}
const coreValue = coreNode[key as keyof DataSourceViewContentNode];

// Special case for folder parents, the ones retrieved using getContentNodesForStaticDataSourceView do not
// contain any parentInternalIds.
if (provider === null && key === "parentInternalIds") {
Expand Down Expand Up @@ -159,6 +161,18 @@ export function computeNodesDiff({
return false;
}

// Special case for Google Drive spreadsheet folders: connectors
// return a type "file" while core returns a type "folder".
if (
key === "type" &&
provider === "google_drive" &&
value === "file" &&
coreNode.type === "folder" &&
coreNode.mimeType === MIME_TYPES.GOOGLE_DRIVE.SPREADSHEET
) {
return false;
}

// Ignore sourceUrls returned by core but left empty by connectors.
if (key === "sourceUrl" && value === null && coreValue !== null) {
return false;
Expand Down

0 comments on commit 8fbe6e8

Please sign in to comment.