fix(zmq): use JSON on wire, accept JSON keywords in parser#493
Open
avinxshKD wants to merge 1 commit intoControlCore-Project:devfrom
Open
fix(zmq): use JSON on wire, accept JSON keywords in parser#493avinxshKD wants to merge 1 commit intoControlCore-Project:devfrom
avinxshKD wants to merge 1 commit intoControlCore-Project:devfrom
Conversation
Author
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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