question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gRPC-Web Developer Tools conflicts with unary interceptors introduced by grpc/grpc-web

See original GitHub issue

I’v found that enabled gRPC-Web Developer Tools (by SafetyCulture) brokes up unary interceptors set up for grpc-web client. Interceptors are being not called when gRPC-Web Developer Tools are enabled.

Issue was found with next code:

const AuthInterceptor = function() {
    this.intercept = function(request, invoker) {
        request.getMetadata().Authorization = AuthService.GetAuthHeaderValue();

        return invoker(request);
    };
};

const options = {"unaryInterceptors": [new AuthInterceptor()]};
const APIClient = new APIPromiseClient(API_URL, null, options);

const enableDevTools = window.__GRPCWEB_DEVTOOLS__ || (() => {});
enableDevTools([
    APIClient,
]);


APIClient.me(new ProtobufEmpty(), {})
    .then(result => {
        ...
    })
    .catch(error => {
        console.error(error);    // <-- when gRPC-Web DevTools are enabled I receive error "no auth header" from my backend
    });

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

5reactions
jrapoportcommented, Dec 21, 2020
1reaction
CyborgMastercommented, Feb 11, 2021

@jrapoport, sorry for the delayed response. Unfortunately that won’t help us here. The IT org has chrome locked down so we can only install extensions from their whitelist, so even if you published it, I’d have to get it through the approval process, which is a bunch of red tape. I understand their concern, there is a fair bit of malware on the chrome extension store.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interceptors in gRPC-Web
Unary interceptor example · It prepends a string to the gRPC request message before the RPC. · It prepends a string to the...
Read more >
grpc/grpc - Gitter
Anyone have experience with grpc-web (commonjs client), grpc-go (server), envoy proxy and server side streaming? I'm getting en error in the client after ......
Read more >
Grpc cancelled - Caritas Castellaneta
Server streaming: This is similar to unary RPC, except that the server returns a stream of ... We will introduce gRPC as a...
Read more >
Connect - Go Packages
Handlers and clients support three protocols: gRPC, gRPC-Web, ... Interceptor) Option; func WithOptions(options . ... It's used in unary interceptors.
Read more >
Beginning gRPC with ASP.NET Core 6
Anthony Giretti is a senior lead software developer at OneOcean in Montreal, Canada. He is a technical leader and four-time Microsoft MVP ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found