Skip to content

fix(zmq): use JSON on wire, accept JSON keywords in parser#493

Open
avinxshKD wants to merge 1 commit intoControlCore-Project:devfrom
avinxshKD:fix/zmq-json-interop
Open

fix(zmq): use JSON on wire, accept JSON keywords in parser#493
avinxshKD wants to merge 1 commit intoControlCore-Project:devfrom
avinxshKD:fix/zmq-json-interop

Conversation

@avinxshKD
Copy link

@avinxshKD avinxshKD commented Mar 6, 2026

Java's ZMQ write() was serializing with toPythonLiteral(), so booleans/null came out as True/False/None. Python's recv_json() calls json.loads() under the hood, which rejects that. Pure-numeric payloads worked by accident; anything with a boolean or null silently broke.

Same issue in reverse: Python's json.dumps() sends true/false/null, and the Java parser only knew True/False/None, throwing IllegalArgumentException on receipt

Fix

  • Added toJsonLiteral() (mirrors toPythonLiteral(), JSON values instead of Python ones) and swapped it in for the ZMQ write() path only, file I/O unchanged.

  • Extended parseKeyword() to accept true/false/null alongside the Python variants, so the parser handles both formats.

Tests

Added testJsonKeywordTrue/False/Null, testJsonMixedList, testJsonRoundTrip to TestLiteralEval.

closes #492

@avinxshKD
Copy link
Author

avinxshKD commented Mar 7, 2026

Hey @pradeeban also after a sim finishes I keep going back to manually check the port files, would a concore export CLI command to dump edge data to CSV make sense? could wire it into the existing CLI like watch #450. Let me know if that's worth working on

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.

1 participant