Skip to content

Commit 4d45c8a

Browse files
mbroadstdaprahamian
authored andcommitted
fix(read-operations): send sessions on all read operations
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.
1 parent 6078bcd commit 4d45c8a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/core/wireprotocol/get_more.js

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ function getMore(server, ns, cursorState, batchSize, options, callback) {
8080
options
8181
);
8282

83+
if (cursorState.session) {
84+
commandOptions.session = cursorState.session;
85+
}
86+
8387
command(server, ns, getMoreCmd, commandOptions, queryCallback);
8488
}
8589

lib/core/wireprotocol/query.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ function query(server, ns, cmd, cursorState, options, callback) {
4646
options
4747
);
4848

49-
if (cmd.readPreference) commandOptions.readPreference = readPreference;
49+
if (cmd.readPreference) {
50+
commandOptions.readPreference = readPreference;
51+
}
52+
53+
if (cursorState.session) {
54+
commandOptions.session = cursorState.session;
55+
}
56+
5057
command(server, ns, findCmd, commandOptions, callback);
5158
}
5259

0 commit comments

Comments
 (0)