Skip to content

[Bug]: Stream Query issues with Blob objectΒ #1839

Open
@tilllt

Description

@tilllt

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am not a programmer but i think Lowcoders "Stream Query" objecst has an issue handling "Blob" objects. I am trying to handle the Websocket messages with largely AI generated code in the Stream Query Success event handler. As far as i understand my trial-and-error, the JSON error i am currently getting is caused by lowcoder and not the Code i use.

i am trying to parse ComfyUI websocket messages, first only to console.log, using Stream Query, (using mainly ai generated code since i am a noob programmer)

"On Success" Event Handler for the Websocket Query
https://pastebin.com/AyCg6aGy

Errors from Browser Console:

https://pastebin.com/Ua9UhK9J

Maybe this is an indicator of what might be going wrong internally at lowcoder, like i said, i have limited understanding of programming. But is it possible that the "Stream Query" Component of Lowcoder is incorrectly handling the "Blob" binary objects that comfyUI returns in its websocket streams?
Β΄
VM2607:1 Uncaught SyntaxError: Unexpected token 'o', "[object Blob]" is not valid JSON
at JSON.parse ()
at socket.onmessage (index-d1d5468c.js:5729:4210)
socket.onmessage @ index-d1d5468c.js:5729
VM2609:1 Uncaught SyntaxError: Unexpected token 'o', "[object Blob]" is not valid JSON
at JSON.parse ()
at socket.onmessage (index-d1d5468c.js:5729:4210)
socket.onmessage @ index-d1d5468c.js:5729

LLM says:
The error is still happening because the issue is in the original WebSocket handler at index-d1d5468c.js:5729:4210, not in our code. The original code is still trying to JSON.parse() the Blob directly.

We need to fix the source of the problem. The issue is that comfyui_websocket_query is being populated with a Blob object, but somewhere in the original code, it's being converted to a string incorrectly.
Β΄

Expected Behavior

Stream Query should handle all edge cases of websocket messages, including binary blobs

Steps to reproduce

listen to comfyUI websocket (wss://comfy.example.org/ws?prompt_id=12312439478)
output resulting image over websocket via the Output to Websocket Node

(ComfyUI Websocket Code)
https://github.com/9elements/comfyui-api/blob/main/basic_api.py

Environment

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

πŸ†• New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions