-
Notifications
You must be signed in to change notification settings - Fork 22
wasm: detailed rpc logs #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome investigation 🚀! The PR looks good, just leaving a few line length comments that needs to be addressed, as we aim to wrap lines at 80 chars.
Great work 🎉🚀!
3942ff3
to
dde87b5
Compare
Perfect! Thanks for the review 😄 pushed up those line length modifications! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀!
@jbrill - we usually wait for 2 ACKs before merging things |
"parameters: rpcName, request, callback") | ||
return js.ValueOf("invalid use of wasmClientInvokeRPC, " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: new line above return
return js.ValueOf("invalid use of wasmClientInvokeRPC, " + | ||
"need 3 parameters: rpcName, request, callback") | ||
} | ||
|
||
if w.lndConn == nil { | ||
log.Errorf("Attempted to invoke RPC but connection is not "+ | ||
"ready") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -340,16 +344,29 @@ func (w *wasmClient) InvokeRPC(_ js.Value, args []js.Value) interface{} { | |||
|
|||
method, ok := w.registry[rpcName] | |||
if !ok { | |||
log.Errorf("RPC method '%s' not found in registry", rpcName) | |||
return js.ValueOf("rpc with name " + rpcName + " not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
return js.ValueOf("rpc with name " + rpcName + " not found") | ||
} | ||
|
||
go func() { | ||
defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have we seen such panics happen?
jsCallback.Invoke(js.ValueOf(err.Error())) | ||
} else { | ||
log.Debugf("RPC '%s' succeeded with result: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would Trace make more sense?
RPC Debug Improvements for WASM Client
Problem
When attempting to call new RPC methods, the frontend would hang without providing any useful debugging information, making it difficult to diagnose issues with RPC registration and execution.
Solution
Enhanced the logging and debugging capabilities of the WASM client's RPC system by:
Changes
Testing
To test these changes:
You should see a log in the console like the following:
Notes
These changes are purely diagnostic and do not modify any functional behavior of the WASM client.