Skip to content

Commit 1610766

Browse files
committed
fixed batch payload handling
1 parent f592aac commit 1610766

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/webapp/app/runEngine/concerns/batchPayloads.server.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export class BatchPayloadProcessor {
119119

120120
// Throw to fail this item - SDK can retry
121121
throw new Error(
122-
`Failed to upload large payload to object store: ${uploadError instanceof Error ? uploadError.message : String(uploadError)}`
122+
`Failed to upload large payload to object store: ${
123+
uploadError instanceof Error ? uploadError.message : String(uploadError)
124+
}`
123125
);
124126
}
125127

@@ -147,6 +149,11 @@ export class BatchPayloadProcessor {
147149
*/
148150
#createPayloadPacket(payload: unknown, payloadType: string): IOPacket {
149151
if (payloadType === "application/json") {
152+
// Payload from SDK is already serialized as a string - use directly
153+
if (typeof payload === "string") {
154+
return { data: payload, dataType: "application/json" };
155+
}
156+
// Non-string payloads (e.g., direct API calls with objects) need serialization
150157
return { data: JSON.stringify(payload), dataType: "application/json" };
151158
}
152159

@@ -162,4 +169,3 @@ export class BatchPayloadProcessor {
162169
}
163170
}
164171
}
165-

0 commit comments

Comments
 (0)