Skip to content

Conversation

@Eomm
Copy link
Contributor

@Eomm Eomm commented Jan 8, 2026

Description

Here:

} catch (err) {

the error is totally ignored and it hides:

TypeError: Cannot read private member #clientSideCache from an object whose class did not declare it

To replicate it:

Given this simple snippet:

import { createClientPool } from '@redis/client';

const pool = createClientPool(
  { host: 'localhost', tls: false, port: 6379 },//
)

await pool.connect();
await pool.close();
console.debug('Closed')

console.debug({
  totalClients: pool.totalClients,
  idleClients: pool.idleClients,
  clientsInUse: pool.clientsInUse
})

It prints:

{ totalClients: 1, idleClients: 1, clientsInUse: 0 }

With the fix it prints:

{ totalClients: 0, idleClients: 0, clientsInUse: 0 }

Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Eomm added 2 commits January 8, 2026 17:56
Add test for closing the client pool and checking total clients.
@jit-ci
Copy link

jit-ci bot commented Jan 8, 2026

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant