Conversation
WalkthroughConsolidates dispute initiator/counterpart selection in admin_take_dispute_action to a three-way match on seller_dispute/buyer_dispute, with early error on invalid combinations. Replaces order_creator_tradekey usage with dispute_initiator in SolverDisputeInfo. Minor formatting-only refactor in db::is_dispute_taken_by_admin without logic changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Admin
participant App as App (admin_take_dispute_action)
participant DB
Admin->>App: Take dispute request
App->>DB: (Optional) is_dispute_taken_by_admin(order_id)
DB-->>App: Boolean/Option
App->>App: Read order.seller_dispute, order.buyer_dispute
alt seller_dispute = true && buyer_dispute = false
Note right of App: Initiator = seller<br/>Counterpart = buyer
App->>App: Build SolverDisputeInfo(dispute_initiator)
App-->>Admin: Proceed with dispute handling
else buyer_dispute = true && seller_dispute = false
Note right of App: Initiator = buyer<br/>Counterpart = seller
App->>App: Build SolverDisputeInfo(dispute_initiator)
App-->>Admin: Proceed with dispute handling
else invalid combination
Note right of App: Early return error
App-->>Admin: DisputeEventError
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
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 |
Don't know what that means, but sounds gooood!! |
@grunch @Catrya ,
this is the fix for #526 , now initiator of dispute is correctly sent to admin( solver ) when the dispute is taken, previously, my bad, I was sending the pubkey of order creator.
Summary by CodeRabbit
Bug Fixes
Refactor