You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I must thank you for this project. As of this writing, I struggled to find a JSON-RPC implementation which is transport-agnostic, works out of the box with TypeScript, and makes use of ECMAScript 6 Proxy objects in order to abstract from the actual communication.
Overall, I did not encounter any problems except for the following one. Let us assume that you have a remote object with a method isReadable which returns true if a document is readable and false otherwise. Furthermore, let us assume that the method is executed on a document which is not readable. The remote call of this method would therefore return false and the expected result for the local method call would therefore also be false. However, instead one receives {} as result.
The problem lies within the lines 261 and 267 of noice-json-rpc.ts. The shortcut result || {} used to give undefined results a default value will also evaluate to {} for false as result and this might be unwanted behavior. Replacing this part with something like result === undefined ? {} : result should fix this issue.
The text was updated successfully, but these errors were encountered:
First of all, I must thank you for this project. As of this writing, I struggled to find a JSON-RPC implementation which is transport-agnostic, works out of the box with TypeScript, and makes use of ECMAScript 6
Proxy
objects in order to abstract from the actual communication.Overall, I did not encounter any problems except for the following one. Let us assume that you have a remote object with a method
isReadable
which returnstrue
if a document is readable andfalse
otherwise. Furthermore, let us assume that the method is executed on a document which is not readable. The remote call of this method would therefore returnfalse
and the expected result for the local method call would therefore also befalse
. However, instead one receives{}
as result.The problem lies within the lines 261 and 267 of
noice-json-rpc.ts
. The shortcutresult || {}
used to giveundefined
results a default value will also evaluate to{}
forfalse
as result and this might be unwanted behavior. Replacing this part with something likeresult === undefined ? {} : result
should fix this issue.The text was updated successfully, but these errors were encountered: