Skip to content

Revert "fix: replace fixed 15s WebSocket reconnect with exponential backoff + jitter"#5712

Closed
beastoin wants to merge 1 commit intomainfrom
revert-5617-fix/issue-5527
Closed

Revert "fix: replace fixed 15s WebSocket reconnect with exponential backoff + jitter"#5712
beastoin wants to merge 1 commit intomainfrom
revert-5617-fix/issue-5527

Conversation

@beastoin
Copy link
Collaborator

Reverts #5617

@beastoin
Copy link
Collaborator Author

Closing — PR #5617 did include dart:math. The import was lost when #5618 was reverted. Just need to re-add the import, not revert this PR.

@beastoin beastoin closed this Mar 16, 2026
@github-actions
Copy link
Contributor

Hey @beastoin 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our roadmap and vision

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community! 💜

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 16, 2026

Greptile Summary

This PR reverts #5617, which replaced the fixed 15-second Timer.periodic WebSocket reconnect with exponential backoff + jitter. The revert restores the original reconnect behavior in capture_provider.dart.

  • Removes _reconnectAttempt counter, _maxBackoffSeconds constant, and _getReconnectDelay() method
  • Restores Timer.periodic(const Duration(seconds: 15), ...) with a rate-limit guard using _keepAliveLastExecutedAt
  • Restores t.cancel() calls inside the periodic timer callback for early-exit conditions
  • Removes the recursive _startKeepAliveServices() call that was used for scheduling the next backoff attempt
  • Removes _reconnectAttempt = 0 reset from onConnected()

The revert is clean — no leftover references to the removed fields or methods. The original 15s fixed-interval reconnect may cause synchronized reconnect storms under high concurrency (the problem #5617 aimed to solve), but this is a deliberate rollback likely due to regressions introduced by the backoff logic.

Confidence Score: 4/5

  • This PR is a clean revert of a single file and is safe to merge
  • Score of 4 reflects that this is a straightforward, clean revert of a single file touching only the WebSocket reconnect logic. The reverted code restores a previously working fixed-interval reconnect pattern. The only concern is re-introducing the synchronized reconnect storm problem that fix: replace fixed 15s WebSocket reconnect with exponential backoff + jitter #5617 aimed to fix, but that's a deliberate product decision.
  • No files require special attention — the single changed file is a clean revert

Important Files Changed

Filename Overview
app/lib/providers/capture_provider.dart Reverts exponential backoff + jitter WebSocket reconnect logic back to fixed 15-second Timer.periodic. The revert is clean and restores the original keep-alive mechanism without residual artifacts.

Sequence Diagram

sequenceDiagram
    participant WS as WebSocket
    participant CP as CaptureProvider
    participant Timer as Timer.periodic(15s)

    WS->>CP: onClosed() / onError()
    CP->>Timer: _startKeepAliveServices()
    loop Every 15 seconds
        Timer->>CP: Check rate limit (1/15s)
        alt Socket connected or device not ready
            CP->>Timer: t.cancel()
        else User not signed in
            CP->>Timer: t.cancel()
        else Device available
            CP->>WS: _initiateWebsocket()
        end
    end
    WS->>CP: onConnected()
    CP->>CP: _transcriptServiceReady = true
Loading

Last reviewed commit: 8ed4791

@beastoin beastoin deleted the revert-5617-fix/issue-5527 branch March 16, 2026 08:59
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