Skip to content

fix(api): accept empty-string dialog.url and party tel at ingest - #206

Merged
howethomas merged 1 commit into
mainfrom
fix/ingest-empty-url-tel
Sep 25, 2026
Merged

howethomas merged 1 commit into
mainfrom
fix/ingest-empty-url-tel

Conversation

@howethomas

Copy link
Copy Markdown
Contributor

Problem

The CON-365 ingest validators (a7a6c30) reject dialog[].url: "" and parties[].tel: "" with 422. Producers send those for calls with no recording and for unknown numbers, and the previous release accepted them.

Replaying one day of a production corpus (9,029 vCons, syntax 0.0.1/0.0.2) through POST /vcon on d441470, 420 (4.6%) were rejected:

  • about 413 with dialog[].url: "" (mostly zero-duration calls, a few long ones)
  • about 6 with parties[].tel of "" or "Anonymous"

A deployment upgrading to current main would start bouncing roughly one call in twenty.

Change

url_valid and tel_valid skip the format check when the value is the empty string (if v and ... instead of if v is not None and ...). The value is kept as is, so the stored vCon matches what was posted. Non-empty malformed values, including "Anonymous", are still rejected.

Tests

  • New common/tests/test_ingest_empty_fields.py: empty url/tel accepted unchanged; "not-a-url" and "Anonymous" still raise. Fails on main, passes here.
  • test_ingest_empty_fields.py, test_invalid_vcon_pipeline.py, test_api.py: 28 passed. None of the existing invalid fixtures rely on an empty url or tel.

🤖 Generated with Claude Code

The CON-365 field validators reject dialog.url "" and parties[].tel "",
which producers send for calls with no recording and for unknown numbers.
Against one day of a production corpus (9,029 vCons) this bounced 420
(4.6%) with 422, all of which the previous release accepted.

Treat the empty string as absent: skip the format check and keep the
value unchanged, so stored vCons stay identical to what was posted.
Malformed values ("not-a-url", "Anonymous") are still rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@howethomas
howethomas merged commit db13737 into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant