-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The signature in src/index.ts looks like this:
export let newHttpBatchRpcSession:<T extends Serializable<T>>
(urlOrRequest: string | Request, init?: RequestInit) => RpcStub<T> =
<any>newHttpBatchRpcSessionImpl;But the implementation in src/batch.ts takes RpcSessionOptions, not RequestInit:
export function newHttpBatchRpcSession(
urlOrRequest: string | Request, options?: RpcSessionOptions): RpcStub {
let sendBatch: SendBatchFunc = async (batch: string[]) => {
let response = await fetch(urlOrRequest, {
method: "POST",
body: batch.join("\n"),
});
if (!response.ok) {
response.body?.cancel();
throw new Error(`RPC request failed: ${response.status} ${response.statusText}`);
}
let body = await response.text();
return body == "" ? [] : body.split("\n");
};
let transport = new BatchClientTransport(sendBatch);
let rpc = new RpcSession(transport, undefined, options);
return rpc.getRemoteMain();
}I found this rather confusing to debug.
chibat
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working