Fix web app speaker diarization and language handling#4285
Fix web app speaker diarization and language handling#4285smian1 merged 3 commits intoBasedHardware:mainfrom
Conversation
Issues: 1. Speaker diarization: Web app checked for 'speakerId' (camelCase) but backend sends 'speaker_id' (snake_case). This caused all speakers to be identified as speaker 0 because the fallback string parsing incorrectly assumed 1-indexed speakers when Deepgram uses 0-indexed. 2. Language support: Web app always used 'multi' regardless of user's language preference, unlike mobile/desktop which fetch user settings. This caused issues for users with single_language_mode enabled. Fixes: - Add 'speaker_id' (snake_case) to the fallback chain in segment parsing - Fetch user's language preference before creating transcription socket
There was a problem hiding this comment.
Code Review
This pull request aims to fix speaker diarization and language handling in the web app. The change for speaker diarization correctly adds speaker_id to the fallback chain, addressing the issue with backend data. However, the language handling fix appears to be incomplete. It fetches the user's language but doesn't consider the single_language_mode preference, which could lead to incorrect language settings for transcription. I've added comments with suggestions to fully implement the intended logic by fetching the complete transcription preferences.
There was a problem hiding this comment.
Pull request overview
This pull request fixes two issues in the web app's transcription functionality: speaker diarization field name mismatch and missing language preference handling.
Changes:
- Added
speaker_id(snake_case) to the speaker field fallback chain in transcription socket message handling - Fetched user's language preference before creating transcription socket with appropriate error handling and 'multi' fallback
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| web/app/src/lib/transcriptionSocket.ts | Added speaker_id field to fallback chain when parsing speaker information from WebSocket messages |
| web/app/src/hooks/useRecording.ts | Imported and called getUserLanguage to fetch user language preference before creating transcription socket |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Fix web app speaker diarization and language handling
Issues:
Speaker diarization: Web app checked for 'speakerId' (camelCase) but
backend sends 'speaker_id' (snake_case). This caused all speakers to
be identified as speaker 0 because the fallback string parsing
incorrectly assumed 1-indexed speakers when Deepgram uses 0-indexed.
Language support: Web app always used 'multi' regardless of user's
language preference, unlike mobile/desktop which fetch user settings.
This caused issues for users with single_language_mode enabled.
Fixes: