You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Sync Audio Pipeline KeyError on Missing Contact Name or ID #19008
If a Firestore person document has an embedding or voiceprint but has no 'name' key (or 'id' is missing), accessing person['name'] raises KeyError: 'name'.
If person found by name is missing 'name' or 'id', indexing person['name'] or person['id'] raises KeyError.
Expected Behavior
build_person_embeddings_cache should ensure person.get('id') is truthy and default name to person.get('name') or 'Unknown'.
identify_speakers_for_segments should guard person and person.get('id') and fallback name to person.get('name') or detected_name.
Reproduction
Run build_person_embeddings_cache with a person document {'id': 'p1', 'speech_samples': [{'embedding': [0.1]*192}]} without a 'name' key: KeyError: 'name' is raised.
Proposed Fix
In build_person_embeddings_cache, guard if emb and person.get('id'): and set 'name': person.get('name') or 'Unknown'.
In identify_speakers_for_segments, check if person and person.get('id'): and set speaker_to_person_map[speaker_id] = (person['id'], person.get('name') or detected_name).
Add unit test coverage in backend/tests/unit/test_sync_pipeline_contact_guards.py.
Activity
kduailabs commentedon Sep 25, 2026
Bounty Program Claim
[email protected])fix(sync): guard KeyError and None person fields during speaker ident…
fix(sync): guard KeyError and None person fields during speaker ident…
fix(sync): guard KeyError and None person fields during speaker ident…