Trade timeline: keep "Order taken" in progress while the taker's deposit is unpaid

Aperta
#927 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter
Ambito
frontend, mobile

Direzione di ricerca

Start with TradeView in lib/features/trades/models/trade_view.dart and the _steps() timeline logic in trade_detail_screen.dart; then read the two named bond and TradeView tests. Trace how waitingBond distinguishes taker from maker so the taker’s first step stays current while the maker never sees “Orden tomada.” Done means both taker roles show step 1 with later steps pending, existing post-bond behavior is preserved, and the maker timeline is correct; add the requested waitingBond timeline widget test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: ui bug

Context

On a node with the anti-abuse bond enabled (apply_to = "take" or "both"), taking an order puts it in WaitingTakerBond. The taker must first pay a bond hold invoice (PayBondInvoice). Only once that bond locks does the trade flow start. For a seller who takes a buy order, a second hold invoice for the full amount follows. These are two separate, sequential HTLCs (mostrod docs/ANTI_ABUSE_BOND.md §6.3).

In the app, both OrderStatus.waitingTakerBond and OrderStatus.waitingMakerBond map to TradeStatus.waitingBond. TradeView (lib/features/trades/models/trade_view.dart) gives that status step: 1.

Problem

While the deposit is unpaid, the trade timeline marks step 2 as current. For a seller, that step is "Bloqueas los sats" / the seller's escrow step (tradeStepInvoiceSeller). For a buyer, it is the buyer's invoice step (tradeStepInvoiceBuyer). Meanwhile, step 1, "Orden tomada", already shows the done check, and the primary button says "Pagar depósito".

Observed on a buy order taken as seller (7,000 ARS):

  • Header: PASO 2 DE 5, title "Bloquea tu depósito para continuar".
  • Timeline: ✓ Orden tomada, ◉ Bloqueas los sats, ○ El comprador envía el pago, ...
  • Button: "Pagar depósito".

This misleads the user in two ways:

  1. The seller may think the deposit locks the trade sats. It does not. The full-amount hold invoice still comes after it, so the second payment request is a surprise.
  2. "Orden tomada" looks done, but the take is not settled yet. Until the deposit locks, the order is still open to others, and another taker who pays their deposit first wins it.

Fix

Do not add a step. While the status is waitingBond for a taker, keep the take step current:

  • Use step: 0 for TradeStatus.waitingBond in TradeView, so the header reads PASO 1 DE 5 (1 de 6 for a buyer).
  • Label step 0 as "Orden tomada" (tradeStepOrderTaken) with the in-progress ring, not the done check, and not "Esperando tomador". Today _steps() in trade_detail_screen.dart picks the label from current == 0 alone (tradeStepWaitingTaker), so it needs the status (or a flag) to tell "waiting for a taker" apart from "taken, deposit pending".
  • Once the bond locks, the order moves to waitingPayment / waitingInvoice and the existing mapping applies: "Orden tomada" gets its check and step 2 becomes current.

Maker bond: waitingMakerBond maps to the same TradeStatus. A maker paying the bond has no taker, so "Orden tomada" would be wrong there. Either keep the maker on "Esperando tomador", or split the status by role.

Acceptance

  • Taker seller and taker buyer with an unpaid deposit: the timeline shows ◉ Orden tomada as current, every later step pending, and the header reads step 1.
  • After the deposit locks, the timeline is unchanged from today.
  • Maker with an unpaid maker bond: no "Orden tomada".
  • Tests: update test/features/trades/models/trade_view_test.dart and test/features/trades/trade_status_bond_test.dart, and add a widget test of the timeline in waitingBond.
Lingua principale
Dart
Stelle
11
Fork
9
Merge medio
2g 1h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MostroP2P/app

Tutte le issue di MostroP2P/app

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.