Skip to content

Commit 4209240

Browse files
committed
fix(kb): store filename with .txt extension for connector documents
Connector documents (e.g. Fireflies transcripts) have titles without file extensions. The DB stored the raw title as filename, but the processing pipeline extracts file extension from filename to determine the parser. On retry/reprocess, this caused "Unsupported file type" errors with the document title treated as the extension. Now stores processingFilename (which includes .txt) instead of the raw title, consistent with what was actually uploaded to storage.
1 parent 506d382 commit 4209240

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/sim/lib/knowledge/connectors/sync-engine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ async function addDocument(
742742
await tx.insert(document).values({
743743
id: documentId,
744744
knowledgeBaseId,
745-
filename: extDoc.title,
745+
filename: processingFilename,
746746
fileUrl,
747747
fileSize: contentBuffer.length,
748748
mimeType: 'text/plain',
@@ -841,7 +841,7 @@ async function updateDocument(
841841
await tx
842842
.update(document)
843843
.set({
844-
filename: extDoc.title,
844+
filename: processingFilename,
845845
fileUrl,
846846
fileSize: contentBuffer.length,
847847
contentHash: extDoc.contentHash,

0 commit comments

Comments
 (0)