PlayNetwork / json-ipc-lib

An ES6 native Node library for creating and consuming a UNIX Domain Socket and messaging with JSON-RPC 2.0 for inter process communication.
7 stars 3 forks source link

fix: verbose call method is broken #7

Closed m-schmoock closed 5 years ago

m-schmoock commented 5 years ago

The verbose call feature seems broken as the Client will always raise method parameter is required. This RP creates the missing testcases that for now fail by intention.

Note: The verbose syntax is introduced on the projects main README.md and the feature is just not working

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.3%) to 91.096% when pulling 2f5c53b9f266046eb7356534710eb7248bfabd8c on m-schmoock:master into 2ccf3193b8a18a1791d9fe4cce8a99da4c0b2113 on PlayNetwork:master.

m-schmoock commented 5 years ago

Also we might have a bug in the message serializer where nodejs will send a stringified string, mening the payload will have "{...}" quotes instead of {...} which causes the server to complain. Why is the npm 1.0.3 release looking so much different to the sourcecode in this repo??

brozeph commented 5 years ago

On line 60 of the Client.js module, there is a ternary expression used to substitute the method argument in as the JSON-RPC request. However, the method argument must be compliant (i.e. must have a properties to defined id, method and params). Based on your findings, it looks like this ternary check is failing... I'll continue to dig and update on this PR.

brozeph commented 5 years ago

Added fix in #8 - there was an error in the if statement that @m-schmoock properly detected... closing this PR in favor of #8 as Babel was updated along with Gulp to reference the latest versions.