-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Problem
When an order with an active dispute is resolved by the users themselves (cooperative cancellation or seller release), the dispute is correctly closed on the backend (Mostro updates the dispute event in Nostr), but the mobile app doesn't reflect this change.
The user continues seeing the dispute as "Initiated" or "In Progress" even though:
- The order was successfully canceled/completed
- The dispute no longer exists functionally
Root Cause
The mobile app subscribes to kind 1059 (Gift Wrap for dispute chat) but does not subscribe to kind 38386 (dispute state events). When Mostro publishes the updated dispute event with status Settled or SellerRefunded, the mobile never sees it.
Proposed Solution
Instead of adding a new subscription or new message type, the mobile should infer that a dispute is closed when its associated order reaches a terminal state.
Logic
When order.status changes to (cooperativelyCanceled | success):
→ If dispute exists with dispute.orderId == order.id (http://order.id/):
→ Mark dispute as closed/resolved in UI
Why this approach?
- No backend changes needed — Mostro already handles everything correctly
- No protocol expansion — No new Actions required
- Simple logic — "Order finished = dispute finished"
- Data already available — Mobile has
dispute.orderIdlinking disputes to orders
Implementation hints
- In
order_notifier.dartor similar, when detecting order transition to terminal state - Check if there's a dispute associated with that order
- Update the dispute status in the local state to "resolved" or equivalent
- Update
dispute_status_badge.dartto recognizesettledandreleasedstatuses (currently falls back to default)
Additional context
Related PR: MostroP2P/mostro#606 (closes dispute on Nostr when seller releases)
The backend is already publishing the correct dispute status to Nostr. This issue is about the mobile correctly reflecting that state.