You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Parallel Batch Requests do not return correct order or requestId #1317
12:02:52.339: [obs-websocket] [WebSocketServer::onOpen] New WebSocket client has connected from [::ffff:127.0.0.1]:59723
OBS Studio Crash Log URL
No response
Expected Behavior
parallel batch requests return data in order of the requests
Current Behavior
CleanShot.2025-09-12.at.12.10.16.mp4
when performing a parallel batch request for GetSourceScreenshot, the data is not returned in order, and optional requestIds are not attached to the correct response data.
I am using the OBS websocket JS package, but this seems to be a lower level problem with the OBS Websocket implementation. I have a list of source names, and I am requesting screenshots of them all:
constsourceNames=['Desktop','cam-only','Termina','Desk View'];constrequest: RequestBatchRequest[]=sourceNames.map((sourceName)=>({requestType: 'GetSourceScreenshot',requestId: sourceName,// This is so we can line them up with the source names in the responserequestData: {
sourceName,imageFormat: 'png',imageWidth: Math.floor(1920/8),imageHeight: Math.floor(1080/8)}}));constpreviews=awaitobs.callBatch(request,{executionType: 2// Parallel});
I am using parallel execution here, and the order at which the items return are random.
I tried to fix this by attaching a requestId to the request, so I can re-order them once the data comes back, however the requestIds do come back in the correct order, but the responseData attached to it is not the correct source.
If I remove parallel execution, it works correctly.
Activity
wesbos commentedon Sep 12, 2025
To add - this behaviour also exists on other calls - not just screenshots. I tried it with
GetSourceFilterListand they were returned out-of-order