A failed upload permanently deletes the recording: no retry, no disk spool #44

Closed
opened 2026-10-27 19:57:41 -04:00 by logan · 1 comment
Owner

call_recorder.upload_recording (drb-edge-node/app/internal/call_recorder.py, ~L787-808) makes one POST with httpx. On any exception it logs and returns None, and the finally block then calls file_path.unlink(). So a C2 outage, network blip, 5xx or timeout loses that call's audio for good.

The only offline buffer is the in-memory deque of call_end MQTT events (mqtt_manager.py, size 35), and that is lost on restart. The audio itself is never kept.

This is the recording foundation: a lost file is a lost call, transcript and incident link.

Fix shape: unlink only after a 2xx. Otherwise move the file to a bounded on-disk spool (size and age caps), retry with backoff, and drain the spool on startup. Treat 4xx (bad key) differently from 5xx/network errors. Needs drb-audio-review.

Found during the 2026-10-27 architecture review.

`call_recorder.upload_recording` (drb-edge-node/app/internal/call_recorder.py, ~L787-808) makes one POST with httpx. On any exception it logs and returns None, and the `finally` block then calls `file_path.unlink()`. So a C2 outage, network blip, 5xx or timeout loses that call's audio for good. The only offline buffer is the in-memory deque of call_end MQTT events (mqtt_manager.py, size 35), and that is lost on restart. The audio itself is never kept. This is the recording foundation: a lost file is a lost call, transcript and incident link. Fix shape: unlink only after a 2xx. Otherwise move the file to a bounded on-disk spool (size and age caps), retry with backoff, and drain the spool on startup. Treat 4xx (bad key) differently from 5xx/network errors. Needs drb-audio-review. Found during the 2026-10-27 architecture review.
logan added the
type
bug
area/recording-audio
priority
p1
kind
behavior-bug
labels 2026-10-27 19:57:41 -04:00
Author
Owner

Fixed in 6b884d5 + b62912b + 5983ae2, merged to main as c57a5b9 (PR #47). Server-side companions #301/#302 are on server branch feat/ai-pipeline-review, not merged yet.

Fixed in 6b884d5 + b62912b + 5983ae2, merged to main as c57a5b9 (PR #47). Server-side companions #301/#302 are on server branch feat/ai-pipeline-review, not merged yet.
logan removed the
priority
p1
label 2026-11-01 06:39:51 -05:00
logan closed this issue 2026-11-01 06:39:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logan/node-26#44