[M3] POST /slabs: an extra payload key breaks the INSERT binding count; unvalidated columns/values raise raw DB errors instead of 400 #83
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
create_slabbuilds its column list from the allowlist but its value list from "payload keys that appear in that column list", so any extra key in the payload shifts the binding count and the INSERT dies with a driver error. Separately, create validates no enum values and no taxonomy foreign keys, so out-of-domain input becomes an unhandledIntegrityError. Both surface as 500s with a stack trace in the log, againstQUALITY-120.Found in a read-only review of
main@b99cbdf(2026-09-20). 63 backend tests pass and both docs gates pass at that commit; these are gaps the green suite does not cover.Observed evidence
backend/slabs.py:108-111:If the payload carries
status(orclient_rev,created_at, ...), that key is picked up by the comprehension and supplied again by the trailing literal list. Reproduced against the real app:Contrast:
update_slabdoes validate taxonomy ids (slabs.py:148-158), so create and update disagree about what a valid slab is.species_id: 999is therefore persisted-able in principle and only fails later at Woo (publish.py:71sends{"id": slab["species_id"]}as a category).Acceptance
price_source,inference_status, status) and the taxonomy FKs are validated on create at least as strictly as on update, returningvalidation/stale_field400/422 — never a driver exception.Related
#77(the UI rebuild will call create; it must not be able to 500 the app)Closed by M3 Option A: main
0c00d25+ UAT QUALITY-110 evidence.0.5.0-m3,woo_reachable: truetest-woook (taxonomy synced)product_id=48147matching reviewed ready setcurrent_options, #83 unknown-field/taxonomy 4xx, #84 health probe+version, #89 Create title/short from review, #98 live-edge from synced edge term + attr slug resolve