File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
apps/webapp/app/runEngine/services Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,18 @@ export class StreamBatchItemsService extends WithRunEngine {
4141 this . payloadProcessor = new BatchPayloadProcessor ( ) ;
4242 }
4343
44+ /**
45+ * Parse a batch friendly ID to its internal ID format.
46+ * Throws a ServiceValidationError with 400 status if the ID is malformed.
47+ */
48+ private parseBatchFriendlyId ( friendlyId : string ) : string {
49+ try {
50+ return BatchId . fromFriendlyId ( friendlyId ) ;
51+ } catch {
52+ throw new ServiceValidationError ( `Invalid batchFriendlyId: ${ friendlyId } ` , 400 ) ;
53+ }
54+ }
55+
4456 /**
4557 * Process a stream of batch items from an async iterator.
4658 * Each item is validated and enqueued to the BatchQueue.
@@ -59,7 +71,7 @@ export class StreamBatchItemsService extends WithRunEngine {
5971 span . setAttribute ( "batchId" , batchFriendlyId ) ;
6072
6173 // Convert friendly ID to internal ID
62- const batchId = BatchId . fromFriendlyId ( batchFriendlyId ) ;
74+ const batchId = this . parseBatchFriendlyId ( batchFriendlyId ) ;
6375
6476 // Validate batch exists and belongs to this environment
6577 const batch = await this . _prisma . batchTaskRun . findFirst ( {
You can’t perform that action at this time.
0 commit comments