fix: preserve numRetries = 0 - #373
Merged
tharropoulos merged 1 commit intoSep 24, 2026
Merged
Conversation
The `|| 3` fallback wrapped the whole ternary, so an explicit `numRetries: 0` was replaced with 3. Bind it to the default branch only. Adds Configuration tests covering explicit zero, positive, negative, and undefined numRetries, with and without nearestNode. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix and regression coverage address the reported behavior with no unresolved issues.
Review effort: Lite
Findings: None
What changed in this PR
Fixes numRetries: 0 being converted to 3 and adds regression coverage.
Changes:
- Preserves explicit zero retry counts.
- Tests zero, positive, negative, undefined, and nearest-node cases.
| File | Summary |
|---|---|
test/Typesense/Configuration.spec.ts |
Adds comprehensive retry-count regression tests. |
src/Typesense/Configuration.ts |
Corrects retry fallback precedence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tharropoulos
approved these changes
Sep 24, 2026
Collaborator
|
Thank you for catching this! |
Contributor
Author
No problem and thank you for merging my fix so quickly @tharropoulos! Do you have an idea when we can expect the next release? P.S. Thank you for your work!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #372
numRetries: 0became 3 because|| 3replaced the ternary's falsy result. A timed-out request was attempted four times instead of once. Removing the wrapping parentheses preserves0and applies the fallback only to the default branch, whichvalidate()guarantees is at least 1.Validation
New unit tests cover these
numRetriesinputs:001,2,10-1undefined/ omittedundefinedwithnearestNodeThe zero case fails on
masterwithexpected 3 to be +0and passes with the fix. Against a local Typesense 29.0 server, the full suite had 158 passed, 32 skipped, and 0 failed.eslint .reports 0 errors and 8 pre-existing warnings in untouched files;tsc --noEmit -p tsconfig.test.jsonis clean.🤖 Generated with Claude Code
Generated with AI under the guidance of John.