mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-06 20:55:23 -05:00
add try catch
This commit is contained in:
@@ -1196,7 +1196,7 @@ function PreviewEditorContent({
|
||||
<div ref={subBlocksRef} className='subblocks-section flex flex-1 flex-col overflow-hidden'>
|
||||
<div className='flex-1 overflow-y-auto overflow-x-hidden'>
|
||||
{/* Not Executed Banner - shown when in execution mode but block wasn't executed */}
|
||||
{isExecutionMode && !executionData && (
|
||||
{isBlockNotExecuted && (
|
||||
<div className='flex min-w-0 flex-col gap-[8px] overflow-hidden border-[var(--border)] border-b px-[12px] py-[10px]'>
|
||||
<div className='flex items-center justify-between'>
|
||||
<Badge variant='gray-secondary' size='sm' dot>
|
||||
|
||||
@@ -33,10 +33,20 @@ export class SnapshotService implements ISnapshotService {
|
||||
|
||||
const existingSnapshot = await this.getSnapshotByHash(workflowId, stateHash)
|
||||
if (existingSnapshot) {
|
||||
await db
|
||||
.update(workflowExecutionSnapshots)
|
||||
.set({ stateData: state })
|
||||
.where(eq(workflowExecutionSnapshots.id, existingSnapshot.id))
|
||||
// The hash covers functional data only (blocks, edges, loops, etc.).
|
||||
// Refresh the stored state so that presentation-only fields like
|
||||
// metadata.name and positions stay up to date.
|
||||
try {
|
||||
await db
|
||||
.update(workflowExecutionSnapshots)
|
||||
.set({ stateData: state })
|
||||
.where(eq(workflowExecutionSnapshots.id, existingSnapshot.id))
|
||||
} catch (error) {
|
||||
logger.warn(
|
||||
`Failed to refresh snapshot stateData for ${existingSnapshot.id}, continuing with existing data`,
|
||||
error
|
||||
)
|
||||
}
|
||||
|
||||
logger.info(
|
||||
`Reusing existing snapshot for workflow ${workflowId} (hash: ${stateHash.slice(0, 12)}...)`
|
||||
|
||||
Reference in New Issue
Block a user