Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(connection): avoid returning readyState = connected if connection state is stale #14812

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: dont treat failed heartbeat as heartbeat
vkarpov15 committed Sep 17, 2024
commit 86fea9341f824d3c72303c51c3b091f6ef4f9c3c
3 changes: 0 additions & 3 deletions lib/drivers/node-mongodb-native/connection.js
Original file line number Diff line number Diff line change
@@ -418,9 +418,6 @@ function _setClient(conn, client, options, dbName) {
client.on('serverHeartbeatSucceeded', () => {
conn._lastHeartbeatAt = Date.now();
});
client.on('serverHeartbeatFailed', () => {
conn._lastHeartbeatAt = Date.now();
});

if (options.monitorCommands) {
client.on('commandStarted', (data) => conn.emit('commandStarted', data));