Skip to content

Conversation

@LuaKT
Copy link

@LuaKT LuaKT commented Jan 25, 2026

WebSocket messages may arrive in multiple chunks. This change accumulates all chunks before processing to ensure complete messages are parsed.

Fixes #276

@devhawk
Copy link
Collaborator

devhawk commented Jan 26, 2026

Thanks @LuaKT! I think we should also add a test here

webSocket.request(1);

if (!last) {
return messageCompleteFuture;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just return null in onText if we are not sending a response. I know the original code returned CompletableFuture.completedStage(null), but futher research indicates it would be more straighforward to return null.

} catch (Exception e) {
logger.error("Conductor Response error", e);
return CompletableFuture.completedStage(null);
return cf;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return null (see previous comment)

} catch (Exception e) {
logger.error("Conductor JSON Parsing error", e);
return CompletableFuture.completedStage(null);
return cf;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return null (see previous comment)

@devhawk
Copy link
Collaborator

devhawk commented Jan 26, 2026

FYI, #271 will require a pretty significant revamp of the conductor code. We test workflow import/export in Python with 100MB JSON files. We'll probably want to switch to incrementally parsing the JSON instead of collecting text chunks, combining into a 100MB string and then feeding that to the JSON parser.

However, I'm not going to have time to work on #271 until the 2nd half of this week at the earliest. If this is blocking you @LuaKT, I'm OK merging this (with suggested changes + at least one test) in the meantime.

@LuaKT
Copy link
Author

LuaKT commented Jan 27, 2026

Hi @devhawk,
Thanks for reviewing. This isn't blocking me so it's probably easier to wait for your proper rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible websocket message truncation

2 participants