Skip to content

Commit 362afd8

Browse files
timjnhdaprahamian
authored andcommitted
fix(ChangeStream): remove startAtOperationTime once we have resumeToken
Removes startAtOperationTime once we have a resumeToken to prevent it from being sent when attempting to resume. Fixes NODE-2022
1 parent 9cde4b9 commit 362afd8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/change_stream.js

+4
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ function processNewChange(args) {
453453

454454
changeStream.resumeToken = change._id;
455455

456+
// wipe the startAtOperationTime if there was one so that there won't be a conflict
457+
// between resumeToken and startAtOperationTime if we need to reconnect the cursor
458+
changeStream.options.startAtOperationTime = undefined;
459+
456460
// Return the change
457461
if (eventEmitter) return changeStream.emit('change', change);
458462
if (typeof callback === 'function') return callback(error, change);

0 commit comments

Comments
 (0)