Skip to content

fix(frontend): treat whitespace-only payment as missing on purchase - #645

Merged
cristim merged 1 commit into
mainfrom
fix/purchase-payment-whitespace
Oct 6, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/purchase-payment-whitespace

Conversation

@cristim

@cristim cristim commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Trim the payment value in the handleExecutePurchase guard added by #643 so a whitespace-only payment is refused like an empty one, and add a jest case for it.

Follow-up from the #643 review; no linked issue.

Summary by CodeRabbit

  • Bug Fixes
    • Whitespace-only payment options are now rejected before purchase submission.

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm effort/xs Trivial / one-liner type/bug Defect labels Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a60599db-0983-4316-8698-aa2127580e96
📥 Commits

Reviewing files that changed from the base of the PR and between df036ad and c32a28a.

📒 Files selected for processing (2)
  • frontend/src/__tests__/purchase-execution-toast.test.ts
  • frontend/src/app.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

Purchase execution now rejects payment values that contain only whitespace. The refusal test includes a whitespace-only payment value.

Changes

Purchase payment validation

Layer / File(s) Summary
Payment option validation
frontend/src/app.ts, frontend/src/__tests__/purchase-execution-toast.test.ts
The payment-option check tests the trimmed value. The refusal test includes a whitespace-only value.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c32a2

The whitespace-only payment case is rejected before purchase submission, and the focused test verifies that behavior. No identified issue blocks merging.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: whitespace-only payment values are treated as missing during purchase execution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@cristim
cristim merged commit 3131779 into main Oct 6, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/bug Defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant