Skip to content

Commit

Permalink
fix: move maxWireVersion update to inside getMore callback
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Jun 15, 2022
1 parent 875b1c3 commit 19ebf83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cursor/change_stream_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,12 @@ export class ChangeStreamCursor<
}

override _getMore(batchSize: number, callback: Callback): void {
this.maxWireVersion = maxWireVersion(this.server);

super._getMore(batchSize, (err, response) => {
if (err) {
return callback(err);
}

this.maxWireVersion = maxWireVersion(this.server);
this._processBatch(response as TODO_NODE_3286 as ChangeStreamAggregateRawResult<TChange>);

this.emit(ChangeStream.MORE, response);
Expand Down

0 comments on commit 19ebf83

Please sign in to comment.