Skip to content

Commit 0de2aad

Browse files
committed
grpc-js: Fix reuse of channel filter stack factory
1 parent 24ee5a0 commit 0de2aad

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/grpc-js/src/filter-stack.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ export class FilterStackFactory implements FilterFactory<FilterStack> {
8888
this.factories.unshift(...filterFactories);
8989
}
9090

91+
clone(): FilterStackFactory {
92+
return new FilterStackFactory(this.factories);
93+
}
94+
9195
createFilter(): FilterStack {
9296
return new FilterStack(
9397
this.factories.map((factory) => factory.createFilter())

packages/grpc-js/src/internal-channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export class InternalChannel {
439439
parentCall: parentCall,
440440
};
441441

442-
const call = new ResolvingCall(this, method, finalOptions, this.filterStackFactory, this.credentials._getCallCredentials(), getNextCallNumber());
442+
const call = new ResolvingCall(this, method, finalOptions, this.filterStackFactory.clone(), this.credentials._getCallCredentials(), getNextCallNumber());
443443

444444
if (this.channelzEnabled) {
445445
this.callTracker.addCallStarted();

0 commit comments

Comments
 (0)