Skip to content

Fix RangeError when baseDelayMs is 0 in RetryInterceptor#17

Merged
insign merged 1 commit into
mainfrom
fix-retry-interceptor-jitter-crash-5163655667391014827
May 13, 2026
Merged

Fix RangeError when baseDelayMs is 0 in RetryInterceptor#17
insign merged 1 commit into
mainfrom
fix-retry-interceptor-jitter-crash-5163655667391014827

Conversation

@insign

@insign insign commented May 12, 2026

Copy link
Copy Markdown
Contributor

Fixes a potential crash in RetryInterceptor where initializing it with baseDelayMs: 0 would result in a RangeError during jitter calculation because Random().nextInt() requires the max value to be positive and greater than 0.

This improvement makes the code more robust against configuration values and adds proper testing to ensure delays can be entirely disabled safely. No external files or markdown files needed updates.


PR created automatically by Jules for task 5163655667391014827 started by @insign

…seDelayMs is greater than 0 before generating a random jitter to prevent a RangeError. Added a test to verify initialization with 0 delay doesn't crash during retry logic.

Co-authored-by: insign <1113045+insign@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@insign insign merged commit d7fbc75 into main May 13, 2026
8 checks passed
@insign insign deleted the fix-retry-interceptor-jitter-crash-5163655667391014827 branch May 13, 2026 07:37
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.

1 participant