Skip to content

Commit 9272b15

Browse files
committed
fix
1 parent 24abd87 commit 9272b15

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,5 +732,13 @@ function shouldApplyPatchPreview(streamingFile: {
732732
function buildAppendPreview(existingContent: string, incomingContent: string): string {
733733
if (incomingContent.length === 0) return existingContent
734734
if (existingContent.length === 0) return incomingContent
735+
// The fetched file can advance to the just-written content before the
736+
// streaming preview clears. Keep append previews idempotent in that window.
737+
if (
738+
existingContent.endsWith(incomingContent) ||
739+
existingContent.endsWith(`\n${incomingContent}`)
740+
) {
741+
return existingContent
742+
}
735743
return `${existingContent}\n${incomingContent}`
736744
}

0 commit comments

Comments
 (0)