Skip to content

Commit

Permalink
[front] Default parents to [documentId] if not specified (#9442)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier authored Dec 17, 2024
1 parent 625a9c4 commit c1e48ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion front/lib/api/data_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ export async function handleDataSourceTableCSVUpsert({
}

const tableId = params.tableId ?? generateRandomModelSId();
const tableParents: string[] = params.parents ?? [];
const tableParents: string[] = params.parents ?? [tableId];

const flags = await getFeatureFlags(owner);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,17 @@ async function handler(
statsDClient.increment("document_no_self_ref.count", 1, statsDTags);
}

const documentId = req.query.documentId as string;

if (r.data.async === true) {
const enqueueRes = await enqueueUpsertDocument({
upsertDocument: {
workspaceId: owner.sId,
dataSourceId: dataSource.sId,
documentId: req.query.documentId as string,
documentId,
tags: r.data.tags || [],
parentId: r.data.parent_id || null,
parents: r.data.parents || [],
parents: r.data.parents || [documentId],
timestamp: r.data.timestamp || null,
sourceUrl,
section,
Expand Down Expand Up @@ -556,7 +558,7 @@ async function handler(
documentId: req.query.documentId as string,
tags: r.data.tags || [],
parentId: r.data.parent_id || null,
parents: r.data.parents || [],
parents: r.data.parents || [documentId],
sourceUrl,
timestamp: r.data.timestamp || null,
section,
Expand Down
2 changes: 1 addition & 1 deletion front/temporal/upsert_queue/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function upsertDocumentActivity(
documentId: upsertQueueItem.documentId,
tags: upsertQueueItem.tags || [],
parentId: upsertQueueItem.parentId || null,
parents: upsertQueueItem.parents || [],
parents: upsertQueueItem.parents || [upsertQueueItem.documentId],
sourceUrl: upsertQueueItem.sourceUrl,
timestamp: upsertQueueItem.timestamp,
section: upsertQueueItem.section,
Expand Down

0 comments on commit c1e48ce

Please sign in to comment.