-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
For some reason, when the server sends back the 402 payment required
response code if the user doesn't already have an L402 token, the client interceptor code doesn't detect that properly and doesn't attempt to create a token, resulting in a terminal error.
It is yet unclear where exactly the problem lies, the following possibilities come to mind:
- The server's response status fields aren't set correctly for the client interceptor to recognize:
Line 466 in b1b0dc5
func sendDirectResponse(w http.ResponseWriter, r *http.Request, - The client library just doesn't look for the response code in the right place (it interprets the error from the stream interceptor, but perhaps it needs to look at response header/trailer fields?)
- This is a limitation of the gRPC Golang library itself and cannot be fixed easily.
In any case, it should be pretty straightforward to set up a new unit test (taking
Line 322 in b1b0dc5
func TestProxyGRPC(t *testing.T) { |
Workarounds
The current workaround in most Lightning Labs application is to make sure we call a non-streaming (unary) gRPC method first, which then triggers the L402 token creation and allows subsequent streaming gRPC methods to work.
Metadata
Metadata
Assignees
Labels
No labels