Skip to content

fix: preserve concurrency: 0 so it disables the limit as documented - #359

Closed
cpruijsen wants to merge 1 commit into
tursodatabase:mainfrom
cpruijsen:fix/issue-351
Closed

cpruijsen wants to merge 1 commit into
tursodatabase:mainfrom
cpruijsen:fix/issue-351

Conversation

@cpruijsen

Copy link
Copy Markdown

concurrency: 0 is documented in api.ts as disabling the limit, but expandConfig turns it into
20, so the one value that is supposed to mean "no limit" is the one that silently gets the default.

The cause is concurrency || 20 in packages/libsql-core/src/config.ts: 0 is falsy, so it takes
the same branch as undefined. Changed to ??, which distinguishes "not supplied" from "supplied as
zero". The surrounding Math.max(0, ...) is unchanged, so a negative value still clamps.

Tests cover the default, an explicit limit, and zero.

Fixes #351

expandConfig normalized the option with `concurrency || 20`, which turns
the documented "0 disables concurrency limits" into the default of 20.
Use `??` so only a missing value falls back to the default.

The sqlite3 client sizes its connection pool from the same config value;
map a preserved 0 to an unbounded pool there too, matching the http and
ws clients where promise-limit treats a falsy limit as pass-through.

Fixes #351
@cpruijsen

Copy link
Copy Markdown
Author

Closing this one so it does not sit in the queue.

@cpruijsen cpruijsen closed this Oct 14, 2026
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.

concurrency: 0 is documented to disable the limit, but expandConfig turns it into 20

1 participant