Skip to content

fix(trades): My Trades status filter classifies with stale status (snapshot cache + DB row never synced back to Pending) #269

Description

@Catrya

Each row's status chip shows the live status (polled via tradeStatusProvider),
but the filter dropdown buckets trades using the status loaded once from the DB
snapshot (rawTradesProviderfilteredTradesWithOrderStateProvider,
trades_providers.dart:195-199). The snapshot only refreshes on
pull-to-refresh / retry / after create-take — changing the filter does not
reload it
(trades_screen.dart:71-76).

Two stale layers cause chip-vs-filter mismatches:

  1. Cache: status changes arriving via gift wrap / 38383 don't invalidate the
    snapshot, so a taken order stays in the "Pending" bucket while its chip says
    "Waiting Invoice".
  2. DB: for own orders the 38383 ingest skips syncing Pending
    (orders.rs:2873), so after a taker-timeout republish the row stays frozen
    at waiting-buyer-invoice — after pull-to-refresh the order appears under
    "Waiting Invoice" with a Pending chip (verified manually).

Proposed fix

Bucket the filter with the same live status the chip uses (single source of
truth), and/or invalidate rawTradesProvider on status-change events. Also
consider allowing the 38383 ingest to write Pending back for own trades so
the persisted status matches reality.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority: highHigh priority

Type

No type

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions