launchdarkly / swift-eventsource

Server-sent events (SSE) client implementation in Swift for iOS, macOS, tvOS, and watchOS
https://launchdarkly.github.io/swift-eventsource/
Other
196 stars 36 forks source link

Reset connectedTime to fix backoff reset behavior #14

Closed tomasf closed 3 years ago

tomasf commented 3 years ago

Previous behavior

If backoffResetThreshold seconds have passed since the last successful connection, the backoff is reset, regardless of whether this is the first reconnection attempt or not, and no further backoff is performed since it gets reset for every attempt.

New behavior

The reset threshold is only considered for the first reconnection attempt after a successful connection, as you would expect.

bwoskow-ld commented 3 years ago

Hi @tomasf,

Thank you for another pull request! As @gwhelanLD mentioned on your other pull request, we'll fix the broken build and will then take a look at this proposed change.

Cheers, @bwoskow-ld

Filed internally as 98443.