fix: strict check for offramp_failed status#210
fix: strict check for offramp_failed status#210Olexandr88 wants to merge 2 commits intoRequestNetwork:mainfrom
Conversation
Signed-off-by: Olexandr88 <radole1203@gmail.com>
WalkthroughRefined conditional checks in invoice status utilities: replaced substring matching with exact equality and explicit status lists to classify invoice/payment statuses more precisely. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile OverviewGreptile SummaryThis PR improves the robustness of invoice status checking by replacing Key Changes:
Why This Matters: Minor Issue: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Payment Client
participant Webhook as Webhook Handler
participant DB as Database
participant UI as Invoice Status UI
Note over Client,UI: Offramp Payment Flow
Client->>Webhook: payment.processing (subStatus: initiated)
Webhook->>DB: Update status to offramp_initiated
DB->>UI: Status: offramp_initiated
UI->>UI: Display orange badge (offramp in progress)
alt Successful Offramp
Client->>Webhook: payment.processing (subStatus: pending_internal_assessment)
Webhook->>DB: Update status to offramp_pending
DB->>UI: Status: offramp_pending
UI->>UI: Display orange badge (offramp in progress)
Client->>Webhook: payment.processing (subStatus: fiat_sent)
Webhook->>DB: Update status to paid
DB->>UI: Status: paid
UI->>UI: Display green badge (completed)
else Failed Offramp
Client->>Webhook: payment.processing (subStatus: failed)
Webhook->>DB: Update status to offramp_failed
DB->>UI: Status: offramp_failed
UI->>UI: Display red badge (failed)
end
Note over UI: Status display uses strict equality checks<br/>to avoid substring matching bugs
|
Use strict equality for offramp_failed status instead of .includes() to avoid incorrect matching of other offramp states
Summary by CodeRabbit