Summary
Passing maxConnectionRetryCount: 0 does not disable retries. The constructor coerces 0 to 1, so the client always retries at least once.
Reproduction
cd /data/GitHub/node-cubrid
node - <<'NODE'
const CUBRID = require('./');
const client = new CUBRID.createConnection({ hosts:['localhost'], maxConnectionRetryCount: 0 });
console.log(client.maxConnectionRetryCount);
NODE
Actual
The script prints 1.
Expected
The script should print 0, so callers can explicitly disable retry loops.
Likely cause
src/CUBRIDConnection.js initializes the field with:
this.maxConnectionRetryCount = maxConnectionRetryCount || 1;
That treats 0 as missing input.
Suggested fix
Use nullish handling instead of ||, for example:
this.maxConnectionRetryCount = maxConnectionRetryCount ?? 1;
or an equivalent explicit undefined check.
Summary
Passing
maxConnectionRetryCount: 0does not disable retries. The constructor coerces0to1, so the client always retries at least once.Reproduction
Actual
The script prints
1.Expected
The script should print
0, so callers can explicitly disable retry loops.Likely cause
src/CUBRIDConnection.jsinitializes the field with:That treats
0as missing input.Suggested fix
Use nullish handling instead of
||, for example:or an equivalent explicit
undefinedcheck.