Skip to content

Commit 48527b1

Browse files
committed
more PR comments
1 parent 3ea69af commit 48527b1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/execution-snapshot/execution-snapshot.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,16 @@ export function ExecutionSnapshot({
128128
}, [traceSpans])
129129

130130
useEffect(() => {
131+
const abortController = new AbortController()
132+
131133
const fetchData = async () => {
132134
try {
133135
setLoading(true)
134136
setError(null)
135137

136-
const response = await fetch(`/api/logs/execution/${executionId}`)
138+
const response = await fetch(`/api/logs/execution/${executionId}`, {
139+
signal: abortController.signal,
140+
})
137141
if (!response.ok) {
138142
throw new Error(`Failed to fetch execution snapshot data: ${response.statusText}`)
139143
}
@@ -142,6 +146,7 @@ export function ExecutionSnapshot({
142146
setData(result)
143147
logger.debug(`Loaded execution snapshot data for execution: ${executionId}`)
144148
} catch (err) {
149+
if (err instanceof Error && err.name === 'AbortError') return
145150
const errorMessage = err instanceof Error ? err.message : 'Unknown error'
146151
logger.error('Failed to fetch execution snapshot data:', err)
147152
setError(errorMessage)
@@ -151,6 +156,8 @@ export function ExecutionSnapshot({
151156
}
152157

153158
fetchData()
159+
160+
return () => abortController.abort()
154161
}, [executionId])
155162

156163
const renderContent = () => {
@@ -252,7 +259,7 @@ export function ExecutionSnapshot({
252259

253260
if (isModal) {
254261
return (
255-
<Modal open={isOpen} onOpenChange={onClose}>
262+
<Modal open={isOpen} onOpenChange={(open) => !open && onClose()}>
256263
<ModalContent size='full' className='flex h-[90vh] flex-col'>
257264
<ModalHeader>Workflow State</ModalHeader>
258265

apps/sim/app/workspace/[workspaceId]/w/components/preview/components/block-details-sidebar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ function BlockDetailsSidebarContent({
408408
const resolveReference = useMemo(() => {
409409
return (reference: string): unknown => {
410410
if (!allBlockExecutions || !workflowBlocks) return undefined
411+
if (!reference.startsWith('<') || !reference.endsWith('>')) return undefined
411412

412413
const inner = reference.slice(1, -1) // Remove < and >
413414
const parts = inner.split('.')

0 commit comments

Comments
 (0)