Design: Post-submission business logic errors — 409 conflicts and 422 validation failures mapped to field-level recovery #18
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
Post-submission business logic errors come back on the Woo response after the user has committed. Two distinct error classes, same recovery screen, different copy and actions.
Error classes
409 Conflict — the only conflict the docs define is duplicate SKU. Recovery: name the conflict and offer the two paths — edit the SKU, or open the existing listing. Never a raw error code.
422 Validation failure — a category or attribute deleted between sync and publish, a price that violates a store rule, or any other value Woo no longer accepts. Recovery: "this value is no longer valid, pick from the current list," mapped back to the specific field.
Design requirements
Acceptance criteria
Linked to docs/refactor-v2. Milestone: POC.
Verified in main @
0c00d25:✅ 409 duplicate SKU: inline recovery with Edit SKU + Open existing product (Publish.svelte lines 92-99)
✅ No raw HTTP codes to user (classify() maps to friendly messages)
✅ Draft retained locally across error-and-retry
⚠️ 422 stale-value: unpublishable path exists (Back to Review) but the specific "value is stale, pick from current list" recovery is not implemented
Moving to post-launch for the 422-stale-value gap.