Skip to content

Commit 8d27e6e

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 c9dc717 commit 8d27e6e

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
@@ -447,6 +447,10 @@ function processNewChange(args) {
447447

448448
changeStream.resumeToken = change._id;
449449

450+
// wipe the startAtOperationTime if there was one so that there won't be a conflict
451+
// between resumeToken and startAtOperationTime if we need to reconnect the cursor
452+
changeStream.options.startAtOperationTime = undefined;
453+
450454
// Return the change
451455
if (eventEmitter) return changeStream.emit('change', change);
452456
if (typeof callback === 'function') return callback(error, change);

0 commit comments

Comments
 (0)