Skip to content
Prev Previous commit
fix(knowledge): handle dotfile names to avoid empty base in filename
Dotfiles like .env would produce an empty base, resulting in '.txt'.
Now falls back to the original name so .env becomes .env.txt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude committed Mar 18, 2026
commit e20ff52f3ad621da9caa5f8e5f02876acd2259ea
2 changes: 1 addition & 1 deletion apps/sim/tools/knowledge/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function inferDocumentFileInfo(documentName: string): {
}
Comment thread
waleedlatif1 marked this conversation as resolved.
}
const base = ext ? documentName.slice(0, documentName.lastIndexOf('.')) : documentName
return { filename: `${base}.txt`, mimeType: 'text/plain' }
return { filename: `${base || documentName}.txt`, mimeType: 'text/plain' }
}

export interface KnowledgeSearchResult {
Expand Down
Loading