Fix display user not updating locally until app restart
All checks were successful
Tests / Python Backend Tests (push) Successful in 5s
Tests / Frontend Tests (push) Successful in 7s
Tests / Rust Sidecar Tests (push) Successful in 3m12s

Engines now read user.name from the config object at transcription time
instead of caching it at init, so name changes take effect immediately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-04-12 10:40:32 -07:00
parent 023bc0218b
commit 1c8c6ad7e8
5 changed files with 17 additions and 25 deletions

View File

@@ -36,18 +36,16 @@ class DeepgramTranscriptionEngine:
# Construction / configuration
# ------------------------------------------------------------------ #
def __init__(self, config, user_name: str = "User", input_device_index: Optional[int] = None):
def __init__(self, config, input_device_index: Optional[int] = None):
"""
Initialise the engine from a :class:`client.config.Config` object.
Args:
config: Application ``Config`` instance.
user_name: Display name attached to transcriptions.
input_device_index: Index of the audio input device to use
(``None`` for the system default).
"""
self.config = config
self.user_name = user_name
self.input_device_index = input_device_index
# Mode: 'managed' (proxy) or 'byok' (direct Deepgram)
@@ -454,7 +452,7 @@ class DeepgramTranscriptionEngine:
text=text,
is_final=is_final,
timestamp=datetime.now(),
user_name=self.user_name,
user_name=self.config.get('user.name', 'User'),
)
if is_final:
if self.final_callback:
@@ -505,7 +503,7 @@ class DeepgramTranscriptionEngine:
text=transcript,
is_final=is_final,
timestamp=datetime.now(),
user_name=self.user_name,
user_name=self.config.get('user.name', 'User'),
)
if is_final:
if self.final_callback:
@@ -536,10 +534,6 @@ class DeepgramTranscriptionEngine:
pass
self._ws = None
def set_user_name(self, user_name: str):
"""Update the user name attached to future transcriptions."""
self.user_name = user_name
def is_recording_active(self) -> bool:
"""Return ``True`` if audio is currently being captured."""
return self._is_recording