Skip to content

Commit b890120

Browse files
committed
revert console update change
1 parent c519034 commit b890120

3 files changed

Lines changed: 13 additions & 46 deletions

File tree

apps/sim/app/api/tools/dropbox/upload/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const logger = createLogger('DropboxUploadAPI')
1717
*/
1818
function httpHeaderSafeJson(value: object): string {
1919
return JSON.stringify(value).replace(/[\u007f-\uffff]/g, (c) => {
20-
return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4)
20+
return `\\u${(`0000${c.charCodeAt(0).toString(16)}`).slice(-4)}`
2121
})
2222
}
2323

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,58 +1058,25 @@ export function useWorkflowExecution() {
10581058
endedAt,
10591059
})
10601060

1061-
// Check if entry exists (created in onBlockStarted)
1062-
// For container blocks like loops/parallels that fail during initialization,
1063-
// onBlockStarted is never called, so we need to create the entry here
1064-
const existingEntries = useTerminalConsoleStore.getState().entries
1065-
const hasExistingEntry = existingEntries.some(
1066-
(entry) => entry.blockId === data.blockId && entry.executionId === executionId
1067-
)
1068-
1069-
if (hasExistingEntry) {
1070-
// Update existing console entry
1071-
updateConsole(
1072-
data.blockId,
1073-
{
1074-
input: data.input || {},
1075-
replaceOutput: {},
1076-
success: false,
1077-
error: data.error,
1078-
durationMs: data.durationMs,
1079-
startedAt,
1080-
endedAt,
1081-
isRunning: false,
1082-
// Pass through iteration context for subflow grouping
1083-
iterationCurrent: data.iterationCurrent,
1084-
iterationTotal: data.iterationTotal,
1085-
iterationType: data.iterationType,
1086-
},
1087-
executionId
1088-
)
1089-
} else {
1090-
// Create new console entry for blocks that failed before starting
1091-
// (e.g., loop/parallel blocks with invalid configuration)
1092-
addConsole({
1061+
// Update existing console entry (created in onBlockStarted) with error data
1062+
updateConsole(
1063+
data.blockId,
1064+
{
10931065
input: data.input || {},
1094-
output: {},
1066+
replaceOutput: {},
10951067
success: false,
10961068
error: data.error,
1097-
durationMs: data.durationMs || 0,
1098-
startedAt: startedAt || new Date().toISOString(),
1099-
executionOrder: data.executionOrder,
1100-
endedAt: endedAt || new Date().toISOString(),
1101-
workflowId: activeWorkflowId,
1102-
blockId: data.blockId,
1103-
executionId,
1104-
blockName: data.blockName || 'Unknown Block',
1105-
blockType: data.blockType || 'unknown',
1069+
durationMs: data.durationMs,
1070+
startedAt,
1071+
endedAt,
11061072
isRunning: false,
11071073
// Pass through iteration context for subflow grouping
11081074
iterationCurrent: data.iterationCurrent,
11091075
iterationTotal: data.iterationTotal,
11101076
iterationType: data.iterationType,
1111-
})
1112-
}
1077+
},
1078+
executionId
1079+
)
11131080
},
11141081

11151082
onStreamChunk: (data) => {

apps/sim/tools/dropbox/download.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ToolConfig } from '@/tools/types'
77
*/
88
function httpHeaderSafeJson(value: object): string {
99
return JSON.stringify(value).replace(/[\u007f-\uffff]/g, (c) => {
10-
return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4)
10+
return `\\u${(`0000${c.charCodeAt(0).toString(16)}`).slice(-4)}`
1111
})
1212
}
1313

0 commit comments

Comments
 (0)