launchdarkly / ruby-eventsource

Server-Sent Events client for Ruby
Other
40 stars 16 forks source link

fix error when delay is zero in JRuby #28

Closed eli-darkly closed 2 years ago

eli-darkly commented 2 years ago

We're doing a random number calculation which causes an ArgumentError, in JRuby only, if the parameter is zero. This could happen when using the Ruby SDK, or when using ruby-eventsource outside of the SDK, if the application explicitly sets the initial reconnect delay to zero.

I found this problem by running the SSE contract tests— after disabling other flaky tests in JRuby that were preventing the CI job from getting that far.

shortcut-integration[bot] commented 2 years ago

This pull request has been linked to Shortcut Story #136142: Ruby-eventsource throws an error in JRuby if initial delay is zero.