Skip to content

Commit e13bbc1

Browse files
committed
add try catch
1 parent 12f3687 commit e13bbc1

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-editor/preview-editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ function PreviewEditorContent({
11961196
<div ref={subBlocksRef} className='subblocks-section flex flex-1 flex-col overflow-hidden'>
11971197
<div className='flex-1 overflow-y-auto overflow-x-hidden'>
11981198
{/* Not Executed Banner - shown when in execution mode but block wasn't executed */}
1199-
{isExecutionMode && !executionData && (
1199+
{isBlockNotExecuted && (
12001200
<div className='flex min-w-0 flex-col gap-[8px] overflow-hidden border-[var(--border)] border-b px-[12px] py-[10px]'>
12011201
<div className='flex items-center justify-between'>
12021202
<Badge variant='gray-secondary' size='sm' dot>

apps/sim/lib/logs/execution/snapshot/service.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,20 @@ export class SnapshotService implements ISnapshotService {
3333

3434
const existingSnapshot = await this.getSnapshotByHash(workflowId, stateHash)
3535
if (existingSnapshot) {
36-
await db
37-
.update(workflowExecutionSnapshots)
38-
.set({ stateData: state })
39-
.where(eq(workflowExecutionSnapshots.id, existingSnapshot.id))
36+
// The hash covers functional data only (blocks, edges, loops, etc.).
37+
// Refresh the stored state so that presentation-only fields like
38+
// metadata.name and positions stay up to date.
39+
try {
40+
await db
41+
.update(workflowExecutionSnapshots)
42+
.set({ stateData: state })
43+
.where(eq(workflowExecutionSnapshots.id, existingSnapshot.id))
44+
} catch (error) {
45+
logger.warn(
46+
`Failed to refresh snapshot stateData for ${existingSnapshot.id}, continuing with existing data`,
47+
error
48+
)
49+
}
4050

4151
logger.info(
4252
`Reusing existing snapshot for workflow ${workflowId} (hash: ${stateHash.slice(0, 12)}...)`

0 commit comments

Comments
 (0)