Skip to content

EventSource: apply aligned reconnect jitter #73

Description

@kdubb

Summary

The cross-runtime EventSource alignment in #70 specifies downward jitter for exponential reconnect delays. Kotlin, Swift, and the new Python runtime apply a factor in the 0.9...1.0 range after the exact first retry, but the current TypeScript reconnect implementation remains deterministic.

Expected behavior

  • Keep the first retry exactly equal to the current base retry interval.
  • For escalated consecutive failed connections, calculate the capped exponential delay and apply downward jitter in the 0.9...1.0 range.
  • Reset escalation after a connection opens, so a later clean close retries at the exact base interval.
  • Add deterministic tests for the exact first retry, jitter bounds, cap behavior, and reset after open.

This is a follow-up to #70 and keeps TypeScript aligned with sunday-kt, sunday-swift, and sunday-python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions