Skip to content

Commit

Permalink
fix(read-operations): send sessions on all read operations
Browse files Browse the repository at this point in the history
Somewhere during the wire protocol refactor we lost support for
sending `lsid` on read operations. This commit reintroduces support
for sessions in all of these code paths.
  • Loading branch information
mbroadst authored and daprahamian committed Aug 13, 2019
1 parent 6078bcd commit 4d45c8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/core/wireprotocol/get_more.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function getMore(server, ns, cursorState, batchSize, options, callback) {
options
);

if (cursorState.session) {
commandOptions.session = cursorState.session;
}

command(server, ns, getMoreCmd, commandOptions, queryCallback);
}

Expand Down
9 changes: 8 additions & 1 deletion lib/core/wireprotocol/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ function query(server, ns, cmd, cursorState, options, callback) {
options
);

if (cmd.readPreference) commandOptions.readPreference = readPreference;
if (cmd.readPreference) {
commandOptions.readPreference = readPreference;
}

if (cursorState.session) {
commandOptions.session = cursorState.session;
}

command(server, ns, findCmd, commandOptions, callback);
}

Expand Down

0 comments on commit 4d45c8a

Please sign in to comment.