fix(ack-pay): reject empty payment option network - #220
kutluhaneth46 wants to merge 1 commit into
Conversation
When network is present, require a non-empty string in both valibot and zod schemas. Omitting the field stays valid. Fixes agentcommercekit#219. AI usage: Cursor assisted locating the gap, writing the schema change, parity tests, and changeset. I reviewed and understand the change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe payment option schemas now reject an empty ChangesPayment network validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Payment options now reject empty network values while continuing to accept omitted or non-empty values; the change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
paymentOptionSchemaacceptednetwork: \"\"even though an empty network is not a meaningful chain hint.v.optional(nonEmptyString); zod usesz.string().min(1).optional(). Omittingnetworkremains valid.networkon both schemas.AI usage
Cursor assisted locating the gap, writing the schema change, parity tests, and changeset. I reviewed and understand the change: when
networkis present it must be non-empty; absence is still allowed.Test plan
pnpm --filter @agentcommercekit/ack-pay exec vitest run src/schemas/payment-option.test.ts— 19/19 passSummary by CodeRabbit
Bug Fixes
networkvalue when the field is provided.networkvalue remains valid.Tests
networkvalues.