Socket
Socket
Sign inDemoInstall

mongodb

Package Overview
Dependencies
Maintainers
8
Versions
548
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb - npm Package Compare versions

Comparing version 6.6.1 to 6.6.2

12

lib/sdam/monitor.js

@@ -139,3 +139,3 @@ "use strict";

get latestRtt() {
return this.rttSampler.last ?? 0; // FIXME: Check if this is acceptable
return this.rttSampler.last;
}

@@ -203,3 +203,4 @@ addRttSample(rtt) {

// NOTE: here we use the latestRtt as this measurement corresponds with the value
// obtained for this successful heartbeat
// obtained for this successful heartbeat, if there is no latestRtt, then we calculate the
// duration
const duration = isAwaitable && monitor.rttPinger

@@ -339,3 +340,3 @@ ? monitor.rttPinger.latestRtt ?? (0, utils_1.calculateDurationInMs)(start)

this.monitor = monitor;
this.latestRtt = monitor.latestRtt;
this.latestRtt = monitor.latestRtt ?? undefined;
const heartbeatFrequencyMS = monitor.options.heartbeatFrequencyMS;

@@ -357,5 +358,2 @@ this[kMonitorId] = (0, timers_1.setTimeout)(() => this.measureRoundTripTime(), heartbeatFrequencyMS);

measureAndReschedule(start, conn) {
if (start == null) {
start = (0, utils_1.now)();
}
if (this.closed) {

@@ -388,3 +386,3 @@ conn?.destroy();

// eslint-disable-next-line github/no-then
connection.command((0, utils_1.ns)('admin.$cmd'), { [commandName]: 1 }, undefined).then(() => this.measureAndReschedule(), () => {
connection.command((0, utils_1.ns)('admin.$cmd'), { [commandName]: 1 }, undefined).then(() => this.measureAndReschedule(start), () => {
this.connection?.destroy();

@@ -391,0 +389,0 @@ this.connection = undefined;

{
"name": "mongodb",
"version": "6.6.1",
"version": "6.6.2",
"description": "The official MongoDB driver for Node.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -222,4 +222,4 @@ import { clearTimeout, setTimeout } from 'timers';

get latestRtt(): number {
return this.rttSampler.last ?? 0; // FIXME: Check if this is acceptable
get latestRtt(): number | null {
return this.rttSampler.last;
}

@@ -308,3 +308,4 @@

// NOTE: here we use the latestRtt as this measurement corresponds with the value
// obtained for this successful heartbeat
// obtained for this successful heartbeat, if there is no latestRtt, then we calculate the
// duration
const duration =

@@ -503,3 +504,3 @@ isAwaitable && monitor.rttPinger

this.monitor = monitor;
this.latestRtt = monitor.latestRtt;
this.latestRtt = monitor.latestRtt ?? undefined;

@@ -526,6 +527,3 @@ const heartbeatFrequencyMS = monitor.options.heartbeatFrequencyMS;

private measureAndReschedule(start?: number, conn?: Connection) {
if (start == null) {
start = now();
}
private measureAndReschedule(start: number, conn?: Connection) {
if (this.closed) {

@@ -572,3 +570,3 @@ conn?.destroy();

connection.command(ns('admin.$cmd'), { [commandName]: 1 }, undefined).then(
() => this.measureAndReschedule(),
() => this.measureAndReschedule(start),
() => {

@@ -575,0 +573,0 @@ this.connection?.destroy();

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc