centrifuge-js expects Uint8Array for data in methods in Protobuf case. When passing non-Uint8Array data is skipped by serialization layer. I guess we can throw exceptions in such cases like we currently do in Python SDK.
For example, this is an incorrect RPC call in Protobuf protocol scenario:
centrifuge.rpc("method", {"input": "hello"})
The correct one is:
const rpcRequestData = {"input": "hello"};
const binaryData = new TextEncoder("utf-8").encode(JSON.stringify(rpcRequestData));
centrifuge.rpc("method", binaryData);
Since the usage is incorrect - throwing exception seems right.
centrifuge-jsexpectsUint8Arrayfor data in methods in Protobuf case. When passing non-Uint8Arraydata is skipped by serialization layer. I guess we can throw exceptions in such cases like we currently do in Python SDK.For example, this is an incorrect RPC call in Protobuf protocol scenario:
The correct one is:
Since the usage is incorrect - throwing exception seems right.