Skip to content

Revert WebSocket reconnect exponential backoff (#5617)#5713

Closed
beastoin wants to merge 1 commit intomainfrom
revert/5617-ws-reconnect-backoff
Closed

Revert WebSocket reconnect exponential backoff (#5617)#5713
beastoin wants to merge 1 commit intomainfrom
revert/5617-ws-reconnect-backoff

Conversation

@beastoin
Copy link
Collaborator

Reverts #5617 per CTO request.

This PR added exponential backoff + jitter for WebSocket reconnection (replacing fixed 15s interval). It introduced min(), pow(), and Random() calls without importing dart:math, which broke the Codemagic build after the related #5618 revert removed the import. The reconnection logic change also affects the core audio capture flow and needs proper testing before re-merging.


by AI for @beastoin

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 16, 2026

Greptile Summary

This PR reverts #5617, which introduced exponential backoff + jitter for WebSocket reconnection in CaptureProvider. The revert restores the original fixed 15-second Timer.periodic reconnection strategy.

Confidence Score: 5/5

  • This is a clean, straightforward git revert restoring well-tested prior behavior — safe to merge.
  • The PR is a single-file revert that restores previously working reconnection logic. No new code is introduced, no dangling references remain, and the reverted state matches what was running in production before fix: replace fixed 15s WebSocket reconnect with exponential backoff + jitter #5617. The revert also fixes an active build break.
  • No files require special attention.

Important Files Changed

Filename Overview
app/lib/providers/capture_provider.dart Clean revert restoring the original fixed 15s Timer.periodic WebSocket reconnect logic, removing broken exponential backoff that depended on missing dart:math import.

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
        alt Rate limited
            CP-->>Timer: Skip (< 15s since last)
        else Socket connected or device not ready
            CP->>Timer: t.cancel()
        else Not signed in
            CP->>Timer: t.cancel()
        else Device available
            CP->>WS: _initiateWebsocket()
            WS-->>CP: onConnected()
        end
    end
Loading

Last reviewed commit: 7b433d5

@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! 💜

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