Repository navigation
fix(api): accept empty-string dialog.url and party tel at ingest - #206
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CON-365 ingest validators (a7a6c30) reject
dialog[].url: ""andparties[].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 /vconond441470, 420 (4.6%) were rejected:dialog[].url: ""(mostly zero-duration calls, a few long ones)parties[].telof""or"Anonymous"A deployment upgrading to current main would start bouncing roughly one call in twenty.
Change
url_validandtel_validskip the format check when the value is the empty string (if v and ...instead ofif 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
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