Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
p2Priority: Important (score 14-21)
Description
When a backend-listen rolling update happens while a user is doing speech profile onboarding, the WebSocket connection is terminated and the user sees "Connection Lost." They cannot resume — they must restart the entire onboarding flow from scratch, losing all progress and recorded audio.
Current Behavior
- User starts speech profile onboarding (6 questions, ~2-3 min flow)
- A
kubectl rollout restartor Helm upgrade cycles backend-listen pods (19-22 pods killed + recreated) - The user's WebSocket (
/v4/listen?onboarding=enabled) is terminated when their pod is killed - App receives socket close → shows "Connection Lost" dialog with only "Try Again" (which pops the page)
- All recorded audio, transcript segments, and answered questions are lost
- User must redo the entire onboarding from question 1
Expected Behavior
User should be able to resume onboarding from where they left off after a connection drop.
Why This Is Bad
- Onboarding is the first experience for new users — a "Connection Lost" error with no recovery creates a terrible first impression
- The user answered 5/6 questions (83% complete) and lost all progress
- Rolling updates happen regularly (every deploy triggers
kubectl rollout restarton backend-listen) - Users on flaky mobile connections (cellular, weak WiFi) hit this even without deploys —
cancelOnError: trueinpure_socket.dart:126kills the connection on any single transient error
Root Cause
- No server-side onboarding state persistence —
OnboardingHandler(backend/utils/onboarding.py) stores all state in memory (answered questions, transcript, current index). When the pod dies, everything is lost. - No client-side reconnection for speech profile —
SpeechProfileProvider(app/lib/providers/speech_profile_provider.dart) has no reconnect logic. WhenonClosed()fires during recording, it shows the error dialog and the user can only go back. - No connection draining during rollout — pods are killed immediately without waiting for active WebSocket sessions to complete.
cancelOnError: trueinpure_socket.dart:126— a single transient network error kills the WebSocket permanently with no retry.
Confirmed Trigger
- Mar 21 rolling update: 19 pods killed + 15 created between 00:00-01:00 UTC
- User screenshot shows "Connection Lost" at 83% (question 5/6: "What do you have planned for today?")
- No errors in backend logs — the pod was simply killed during the rollout
Affected Areas
| File | Description |
|---|---|
backend/utils/onboarding.py |
In-memory only state, no persistence |
app/lib/providers/speech_profile_provider.dart |
No reconnect/resume logic |
app/lib/pages/onboarding/speech_profile_widget.dart |
Error dialog only offers "Try Again" (restart) |
app/lib/services/sockets/pure_socket.dart:126 |
cancelOnError: true kills connection on transient errors |
Possible Solutions
- Short-term: client-side reconnect + resume — on socket close during onboarding, auto-reconnect the WebSocket and resend the current question index so the backend picks up from the right question. Answered questions and audio are already stored client-side in the provider.
- Short-term: graceful pod drain — add
terminationGracePeriodSecondsand preStop hook to backend-listen pods to allow active WebSocket sessions to complete before killing. - Medium-term: server-side onboarding state in Redis — persist question progress and answers in Redis keyed by UID so a new pod can resume from where the old one left off.
- Quick fix:
cancelOnError: false— changepure_socket.dart:126so transient network errors don't immediately kill the connection.
by AI for @beastoin
Metadata
Metadata
Assignees
Labels
p2Priority: Important (score 14-21)
Activity
beastoin commentedon Mar 21, 2026
User report source: https://www.reddit.com/r/OmiAI/s/h4hRQ1rWKd
by AI for @beastoin