File tree Expand file tree Collapse file tree 5 files changed +13
-13
lines changed
Expand file tree Collapse file tree 5 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,6 @@ async function handleExternalUrl(
372372
373373 logger . info ( `Downloaded file from URL: ${ url } , size: ${ buffer . length } bytes` )
374374
375- // Store file in execution storage if execution context is provided
376375 let userFile : UserFile | undefined
377376 const mimeType = response . headers . get ( 'content-type' ) || getMimeTypeFromExtension ( extension )
378377
Original file line number Diff line number Diff line change 22
33import { useRef , useState } from 'react'
44import { createLogger } from '@sim/logger'
5- import { isUserFile } from '@/lib/core/utils/user-file'
5+ import { isUserFileWithMetadata } from '@/lib/core/utils/user-file'
66import type { ChatFile , ChatMessage } from '@/app/chat/components/message/message'
77import { CHAT_ERROR_MESSAGES } from '@/app/chat/constants'
88
@@ -17,7 +17,7 @@ function extractFilesFromData(
1717 return files
1818 }
1919
20- if ( isUserFile ( data ) ) {
20+ if ( isUserFileWithMetadata ( data ) ) {
2121 if ( ! seenIds . has ( data . id ) ) {
2222 seenIds . add ( data . id )
2323 files . push ( {
@@ -232,7 +232,7 @@ export function useChatStreaming() {
232232 return null
233233 }
234234
235- if ( isUserFile ( value ) ) {
235+ if ( isUserFileWithMetadata ( value ) ) {
236236 return null
237237 }
238238
@@ -285,7 +285,7 @@ export function useChatStreaming() {
285285
286286 const value = getOutputValue ( blockOutputs , config . path )
287287
288- if ( isUserFile ( value ) ) {
288+ if ( isUserFileWithMetadata ( value ) ) {
289289 extractedFiles . push ( {
290290 id : value . id ,
291291 name : value . name ,
Original file line number Diff line number Diff line change 1- import { isUserFile } from '@/lib/core/utils/user-file'
1+ import { isUserFileWithMetadata } from '@/lib/core/utils/user-file'
22import {
33 classifyStartBlockType ,
44 getLegacyStarterMode ,
@@ -234,7 +234,7 @@ function getFilesFromWorkflowInput(workflowInput: unknown): UserFile[] | undefin
234234 return undefined
235235 }
236236 const files = workflowInput . files
237- if ( Array . isArray ( files ) && files . every ( isUserFile ) ) {
237+ if ( Array . isArray ( files ) && files . every ( isUserFileWithMetadata ) ) {
238238 return files
239239 }
240240 return undefined
Original file line number Diff line number Diff line change 11import { createLogger } from '@sim/logger'
2- import { isUserFile } from '@/lib/core/utils/user-file'
2+ import { isUserFileWithMetadata } from '@/lib/core/utils/user-file'
33import type { ExecutionContext } from '@/lib/uploads/contexts/execution/utils'
44import { generateExecutionFileKey , generateFileId } from '@/lib/uploads/contexts/execution/utils'
55import type { UserFile } from '@/executor/types'
@@ -169,7 +169,7 @@ export async function uploadFileFromRawData(
169169 context : ExecutionContext ,
170170 userId ?: string
171171) : Promise < UserFile > {
172- if ( isUserFile ( rawData ) ) {
172+ if ( isUserFileWithMetadata ( rawData ) ) {
173173 return rawData
174174 }
175175
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ interface HydrationState {
2323}
2424
2525export interface Base64HydrationOptions {
26- requestId : string
26+ requestId ? : string
2727 executionId ?: string
2828 logger ?: Logger
2929 maxBytes ?: number
@@ -148,13 +148,14 @@ async function resolveBase64(
148148 }
149149
150150 let buffer : Buffer | null = null
151+ const requestId = options . requestId ?? 'unknown'
151152
152153 if ( file . key ) {
153154 try {
154- buffer = await downloadFileFromStorage ( file , options . requestId , logger )
155+ buffer = await downloadFileFromStorage ( file , requestId , logger )
155156 } catch ( error ) {
156157 logger . warn (
157- `[${ options . requestId } ] Failed to download ${ file . name } from storage, trying URL fallback` ,
158+ `[${ requestId } ] Failed to download ${ file . name } from storage, trying URL fallback` ,
158159 error
159160 )
160161 }
@@ -164,7 +165,7 @@ async function resolveBase64(
164165 try {
165166 buffer = await downloadFileFromUrl ( file . url , timeoutMs )
166167 } catch ( error ) {
167- logger . warn ( `[${ options . requestId } ] Failed to download ${ file . name } from URL` , error )
168+ logger . warn ( `[${ requestId } ] Failed to download ${ file . name } from URL` , error )
168169 }
169170 }
170171
You can’t perform that action at this time.
0 commit comments