Problem
/v1/sync-local-files returns HTTP 500 when Deepgram returns no words for audio segments (silence/noise-only audio). The entire request fails even though the infrastructure is healthy — the audio was simply silent.
Error pattern:
sync_local_files partial failure success=0/N errors=["Deepgram returned no words for segment..."]
Impact
- Significant error rate for heavy sync users (paying subscribers using Limitless devices with
private_cloud_sync_enabled)
- Triggers 5xx alerts unnecessarily — these are not infrastructure failures
- Clients retry failed requests, amplifying backend load
- Users experience sync failures for recordings that contain silence or low-quality audio segments
Expected Behavior
- Empty Deepgram transcription (no words) should be treated as a successful-but-empty segment, not an error
- Return 207 Multi-Status with per-segment results:
- Segments with transcription → success with content
- Segments with no words → success with empty transcript (not an error)
- Segments with actual failures (DG timeout, auth error, infra issue) → error
- Only return 500 for real infrastructure failures
Current Behavior
Any segment where Deepgram returns no words causes the entire request to fail with 500, even when DG processed the audio successfully — it just had nothing to transcribe.
Location
backend/routers/sync.py — the sync_local_files endpoint
Fix Direction
- In the segment processing loop, distinguish between "DG returned successfully but with no words" vs "DG failed"
- Treat no-words as a successful empty result, not an exception
- Aggregate per-segment results and return 207 when there's a mix of outcomes
- Reserve 500 for actual infrastructure errors (timeouts, auth failures, connection errors)
Problem
/v1/sync-local-filesreturns HTTP 500 when Deepgram returns no words for audio segments (silence/noise-only audio). The entire request fails even though the infrastructure is healthy — the audio was simply silent.Error pattern:
Impact
private_cloud_sync_enabled)Expected Behavior
Current Behavior
Any segment where Deepgram returns no words causes the entire request to fail with 500, even when DG processed the audio successfully — it just had nothing to transcribe.
Location
backend/routers/sync.py— thesync_local_filesendpointFix Direction