Skip to content

v0.4: Enable guarded automatic reconnect from sustained RED #5

Description

@Mewt0

Goal

Connect the validated RED detector to the validated reconnect controller with conservative safeguards.

Preconditions

Scope

  • Enable auto reconnect only after continuous RED exceeds the configured grace period.
  • Require valid battle/reconnectable state and reject replay.
  • Re-check IConnectionManager.isConnected() immediately before forcing disconnect.
  • Single-flight one outage -> one reconnect attempt.
  • Reset only after a healthy/reconnected state is observed.
  • Add cooldown/backoff policy with a conservative default of one automatic attempt per outage.
  • Preserve Ctrl+K as manual fallback.

State machine

MONITORING -> LAG_SUSPECTED -> RECONNECTING -> WAITING_LOGIN -> CONNECTING -> MONITORING

Terminal/guard paths must return to a safe idle/login state without retry loops.

Acceptance criteria

  • Brief RED spikes never disconnect.
  • Sustained validated RED can trigger exactly one reconnect.
  • No duplicate trigger from callback races or repeated samples.
  • If WoT has already disconnected itself, SmartReconnect does not force a second disconnect.
  • Long internet outages do not create an infinite login loop.
  • Manual fallback remains functional.

Tests

  • 0.5-2s RED spikes.
  • 3s+ sustained RED.
  • RED recovers at the threshold boundary.
  • stock disconnect races the SmartReconnect threshold.
  • long offline period.
  • server-side outage/restart.
  • exit/arena change while RED is active.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions