Commit c92dba2
[Fix] 020-twilio-media-streams — handle missing ffmpeg and null stderr crash (#56)
## Summary
- Add `ensureFfmpeg()` helper that auto-installs ffmpeg via apt-get when
missing from CI runner
- Guard against null `result.error` / `result.stderr` from `spawnSync`
when binary is not found
- Remove stale comment claiming ffmpeg is pre-installed on all runners
## Root cause
The `ubuntu-24.04` GitHub Actions runner image (`20260323.65`) no longer
ships `ffmpeg` pre-installed. `spawnSync('ffmpeg', ...)` returns `{
status: null, stderr: null, error: ENOENT }` when the binary is missing,
and the test's error handler did `result.stderr.toString()` without a
null check — crashing with `Cannot read properties of null (reading
'toString')`.
## Test plan
- [ ] CI test passes: ffmpeg is installed on-demand if not present
- [ ] CI test passes: POST /voice returns TwiML with `<Stream>` element
- [ ] CI test passes: WebSocket pipeline streams mulaw audio → Deepgram
and receives transcript
Supersedes #47 (same fix, yesterday's branch had no CI runs).
🤖 Generated with [Claude Code](https://claude.ai/code)
---------
Co-authored-by: examples-bot <noreply@deepgram.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Luke Oliff <luke@lukeoliff.com>1 parent 0e4d37f commit c92dba2
1 file changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | | - | |
| 59 | + | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
| |||
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
| |||
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
209 | | - | |
| 221 | + | |
210 | 222 | | |
211 | | - | |
212 | | - | |
| 223 | + | |
213 | 224 | | |
214 | | - | |
| 225 | + | |
215 | 226 | | |
216 | | - | |
| 227 | + | |
217 | 228 | | |
218 | 229 | | |
219 | 230 | | |
220 | | - | |
| 231 | + | |
221 | 232 | | |
222 | 233 | | |
223 | 234 | | |
| |||
0 commit comments