Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 2b81bb6

Browse files
committed
fix(sessions): actually allow ending of sessions
Currently, endSessions filters out any calls that happen while the topology is connected. However, it is impossible to send an endSessions command if you are not connected. This fix allows sessions to be ended while the topology is connected Part of HELP-5834
1 parent 2d3fa98 commit 2b81bb6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/topologies/shared.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,6 @@ function resolveClusterTime(topology, $clusterTime) {
378378
// to share code.
379379
const SessionMixins = {
380380
endSessions: function(sessions, callback) {
381-
if (this.isConnected()) {
382-
if (typeof callback === 'function') callback();
383-
return;
384-
}
385-
386381
if (!Array.isArray(sessions)) {
387382
sessions = [sessions];
388383
}
@@ -395,7 +390,7 @@ const SessionMixins = {
395390
// Is it enough to use: ReadPreference.primaryPreferred ?
396391
this.command(
397392
'admin.$cmd',
398-
{ endSessions: sessions.map(s => s.id) },
393+
{ endSessions: sessions },
399394
{ readPreference: ReadPreference.primaryPreferred },
400395
() => {
401396
// intentionally ignored, per spec

0 commit comments

Comments
 (0)