Skip to content

fix(api-call): report the timeout when every retry ends in a 408 - #127

Merged
tharropoulos merged 2 commits into
typesense:masterfrom
arpitjain099:fix/408-retry-exhaustion
Nov 23, 2026
Merged

tharropoulos merged 2 commits into
typesense:masterfrom
arpitjain099:fix/408-retry-exhaustion

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

Change Summary

Every retryable branch in makeRequest() records $lastException except the 408 one, which only continues. So when every attempt times out, the loop ends with $lastException null, the throw at the bottom is skipped, and the method returns null implicitly. Documents::search() is declared : array, so the caller gets a TypeError, and since that is an Error rather than an Exception, neither catch (TypesenseClientError) nor catch (Exception) sees it. Collection::update(), Collection::delete() and Documents::delete() are the same shape.

The 408 branch now keeps the exception before continuing, as #97 did for the 5xx and network branches, leaving retry count and timing alone. Two tests cover an all-408 run, through ApiCall::get() and through Documents::search(). Both fail on master; here the suite is 134 tests, 224 assertions, OK against Typesense 30.0.alpha1 with the flags from tests.yml.

PR Checklist

arpitjain099 and others added 2 commits November 15, 2026 13:07
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@tharropoulos
tharropoulos merged commit bcdb36c into typesense:master Nov 23, 2026
1 check passed
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.

2 participants