Skip to content

Commit 59a2cbc

Browse files
committed
grpc-js: Remove redundant calls to setCredentials
1 parent 8a312e6 commit 59a2cbc

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

packages/grpc-js/src/client-interceptors.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ export interface InterceptingCallInterface {
198198
sendMessage(message: any): void;
199199
startRead(): void;
200200
halfClose(): void;
201-
202-
setCredentials(credentials: CallCredentials): void;
203201
}
204202

205203
export class InterceptingCall implements InterceptingCallInterface {
@@ -337,9 +335,6 @@ export class InterceptingCall implements InterceptingCallInterface {
337335
}
338336
});
339337
}
340-
setCredentials(credentials: CallCredentials): void {
341-
this.nextCall.setCredentials(credentials);
342-
}
343338
}
344339

345340
function getCall(channel: Channel, path: string, options: CallOptions): Call {
@@ -371,9 +366,6 @@ class BaseInterceptingCall implements InterceptingCallInterface {
371366
getPeer(): string {
372367
return this.call.getPeer();
373368
}
374-
setCredentials(credentials: CallCredentials): void {
375-
this.call.setCredentials(credentials);
376-
}
377369
// eslint-disable-next-line @typescript-eslint/no-explicit-any
378370
sendMessageWithContext(context: MessageContext, message: any): void {
379371
let serialized: Buffer;

packages/grpc-js/src/client.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,6 @@ export class Client {
321321
* before calling the CallInvocationTransformer, and we need to create the
322322
* call after that. */
323323
emitter.call = call;
324-
if (callProperties.callOptions.credentials) {
325-
call.setCredentials(callProperties.callOptions.credentials);
326-
}
327324
let responseMessage: ResponseType | null = null;
328325
let receivedStatus = false;
329326
const callerStackError = new Error();
@@ -449,9 +446,6 @@ export class Client {
449446
* before calling the CallInvocationTransformer, and we need to create the
450447
* call after that. */
451448
emitter.call = call;
452-
if (callProperties.callOptions.credentials) {
453-
call.setCredentials(callProperties.callOptions.credentials);
454-
}
455449
let responseMessage: ResponseType | null = null;
456450
let receivedStatus = false;
457451
const callerStackError = new Error();
@@ -582,9 +576,6 @@ export class Client {
582576
* before calling the CallInvocationTransformer, and we need to create the
583577
* call after that. */
584578
stream.call = call;
585-
if (callProperties.callOptions.credentials) {
586-
call.setCredentials(callProperties.callOptions.credentials);
587-
}
588579
let receivedStatus = false;
589580
const callerStackError = new Error();
590581
call.start(callProperties.metadata, {
@@ -681,9 +672,6 @@ export class Client {
681672
* before calling the CallInvocationTransformer, and we need to create the
682673
* call after that. */
683674
stream.call = call;
684-
if (callProperties.callOptions.credentials) {
685-
call.setCredentials(callProperties.callOptions.credentials);
686-
}
687675
let receivedStatus = false;
688676
const callerStackError = new Error();
689677
call.start(callProperties.metadata, {

0 commit comments

Comments
 (0)