fix: web recorder ignores selected transcription language, always sends multi#5547
fix: web recorder ignores selected transcription language, always sends multi#5547krushnarout wants to merge 2 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR fixes a bug where the web recorder always sent Changes:
The fix is minimal, correct, and well-scoped. The only minor gap is that the endpoint docstring at line 511 was not updated to reflect the new Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant WebRecorder as Web Recorder
participant API as GET /v1/users/transcription-preferences
participant DB as Firestore (users/{uid})
WebRecorder->>API: GET transcription-preferences
API->>DB: user_ref.get()
DB-->>API: user_doc { language, transcription_preferences: { single_language_mode, vocabulary } }
API-->>WebRecorder: { single_language_mode, vocabulary, language }
Note over WebRecorder: language is now "de" (not undefined)
WebRecorder->>WebRecorder: Build WS URL with language=de
|
| return { | ||
| 'single_language_mode': prefs.get('single_language_mode', False), | ||
| 'vocabulary': prefs.get('vocabulary', []), | ||
| 'language': user_data.get('language', ''), |
There was a problem hiding this comment.
Why do we need to make changes to the backend? How has the mobile app been working with language detection without any of these backend changes?
There was a problem hiding this comment.
mobile app:
When a user changes their language in the app, INFO: 192.168.1.25:58408 - "PATCH /v1/users/language HTTP/1.1" 200 OK change the language, but when building the socket url for transcription, the app reads language directly from local SharedPreferences on the device. It never asks the backend for it.
web:
It fetches language from GET /v1/users/transcription-preferences at recording time. The problem was that endpoint never returned a language field, so prefs.language was always undefined, causing the recorder to fall back to language=multi, adding language to that response, so the web recorder can read what the user actually chose, PATCH /v1/users/language already saved it correctly to firestore
Cause
GET /v1/users/transcription-preferencesnever returned thelanguagefield, soprefs.languagewas alwaysundefinedin the recorder. This caused the WebSocket to fall back tolanguage=multi(auto-detect), overriding whatever language the user had set in Settings.Fix
languagefield toTranscriptionPreferencesResponseinbackend/routers/users.pyget_user_transcription_preferencesinbackend/database/users.pyto read and return the top-levellanguagefield from the user documentDemo
Before
Screen.Recording.2026-03-10.at.10.36.23.PM.mov
After
Screen.Recording.2026-03-10.at.10.59.08.PM.mov
closes #4808