Skip to content

Conversation

VisargD
Copy link
Collaborator

@VisargD VisargD commented Mar 29, 2025

Code Quality ![type: bug fix](https://img.shields.io/badge/type:_bug fix-818aff)

Title:

  • chore: add default status codes only when retry attempts are configured

Description:

🔄 What Changed

Modified the retry logic in handlerUtils.ts to only set default status codes for retry when retry attempts are actually configured (greater than 0).

🔍 Impact of the Change

Improves the behavior of the retry mechanism by ensuring that retry status codes are only set when retry attempts are actually configured. This prevents unnecessary configuration when retries are not being used.

📁 Total Files Changed

1 file changed with 3 additions and 1 deletion in src/handlers/handlerUtils.ts.

🧪 Test Added

N/A - The change is a minor logic improvement that doesn't require specific test coverage.

🔒 Security Vulnerabilities

N/A - No security vulnerabilities were introduced or addressed in this PR.

Motivation:

  • This change improves the retry logic by only setting default retry status codes when retry attempts are actually configured, making the code more logical and efficient.

Related Issues:

@VisargD VisargD merged commit 0977385 into main Mar 29, 2025
1 check passed
@VisargD VisargD deleted the fix/retry-count-in-response-for-default-codes branch March 29, 2025 08:48
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.

x-portkey-retry-attempt-count response header is getting marked as -1 for default retry status codes
1 participant