ts-proto
ts-proto copied to clipboard
Rpc doesn't account for metadata
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
There's an option to include a metadata?: Metadata arg, but only under certain providers. There's also no option to receive Metadata from the response.
This seems like a pretty wide-ranging potential change. Have people run into this problem before?
I think most users have used metadata on the server, i.e. to accept incoming data like auth headers.
Also I think that its the client Rpc
implementations that put this metadata on the wire, and not the individual call sites that are calling SomeService.someMethod
.
If you needed to pass per-callsite metadata into a await someService.someMethod(...)
call, and have that passed through the Rpc
interface, then yeah we do not support that atm.
Do you need to do that? Or can you follow the ^ pattern and have the Rpc
implementation generically put the same auth/user metadata on the wire for all calls?
We’re trying to thread trace ids through, which gets tricky I think. Let me think more about workaroundsOn Apr 13, 2024, at 12:44 PM, Stephen Haberman @.***> wrote: I think most users have used metadata on the server, i.e. to accept incoming data like auth headers. Also I think that its the client Rpc implementations that put this metadata on the wire, and not the individual call sites that are calling SomeService.someMethod. If you needed to pass per-callsite metadata into a await someService.someMethod(...) call, and have that passed through the Rpc interface, then yeah we do not support that atm. Do you need to do that? Or can you follow the ^ pattern and have the Rpc implementation generically put the same auth/user metadata on the wire for all calls?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>