From c8bbaa753356aabf3483f549a77d1d2f2dac70ff Mon Sep 17 00:00:00 2001 From: philipperolet Date: Wed, 6 Sep 2023 18:05:29 +0200 Subject: [PATCH] Slack connector parents field update during sync --- connectors/src/connectors/slack/temporal/activities.ts | 4 ++-- core/src/data_sources/data_source.rs | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/connectors/src/connectors/slack/temporal/activities.ts b/connectors/src/connectors/slack/temporal/activities.ts index 33a0b93db87e..e3e927880609 100644 --- a/connectors/src/connectors/slack/temporal/activities.ts +++ b/connectors/src/connectors/slack/temporal/activities.ts @@ -412,7 +412,7 @@ export async function syncNonThreaded( documentUrl: sourceUrl, timestampMs: createdAt, tags, - parents: [], + parents: [channelId], upsertContext: { sync_type: isBatchSync ? "batch" : "incremental", }, @@ -559,7 +559,7 @@ export async function syncThread( documentUrl: sourceUrl, timestampMs: createdAt, tags, - parents: [], + parents: [channelId], upsertContext: { sync_type: isBatchSync ? "batch" : "incremental", }, diff --git a/core/src/data_sources/data_source.rs b/core/src/data_sources/data_source.rs index 06fbf68aa7de..3f0ad1338d48 100644 --- a/core/src/data_sources/data_source.rs +++ b/core/src/data_sources/data_source.rs @@ -109,10 +109,12 @@ pub struct Chunk { /// if the document’s id is selected as a parent filter, the document itself /// shows up in the search. /// +/// /// Note however that the hierarchical system depends on the managed datasource. -/// For example, in the Slack managed datasource, documents only have a single -/// parent in the array, their channel (since a channel does not have any -/// parent). +/// For example, in the Slack managed datasource, documents are aggregated +/// messages from a channel. A channel does not have any parent, and there are +/// no slack ids for our slack "documents" so the only value in the parents +/// array is the slack channel id /// /// Parents are at the time of writing only relevant for managed datasources /// since standard datasources do not allow specifying a hierarchy. A parent is