Skip to content

Conversation

@tharropoulos
Copy link
Contributor

Change Summary

Fix #96 by adding checks for 400-ranged statuses, in order to throw when the call first gets a 400-ranged response.

PR Checklist

anthonybachour and others added 3 commits June 18, 2025 17:02
- remove duplicate `$statusCode` variable assignment in `ApiCall.php`
- clean up redundant conditional check for status code 408
- simplify exception handling flow for better code readability
- Add `ApiCallRetryTest.php` with tests for exception handling scenarios
- Test retry logic for server errors, client errors, and timeout responses
- Verify 4xx errors are not retried while 5xx errors trigger retries
- Test node health check updates after failed requests
- Ensure 408 timeout errors are skipped and retrying continues
@tharropoulos
Copy link
Contributor Author

Now also addresses #100

- refactor exception handling to separate typesense client errors from network errors
- fix sleep logic to only execute between retry attempts, not after final attempt
- add test to verify no sleep occurs on final retry attempt with timing validation
@tharropoulos tharropoulos force-pushed the dont-throw-on-node-retry branch from 69b19dc to 33d30dc Compare July 16, 2025 14:09
@tharropoulos
Copy link
Contributor Author

@jasonbosco

@jasonbosco jasonbosco merged commit 1fbf79e into typesense:master Aug 15, 2025
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.

3 participants