fix(exchange): stop one unparseable order from wiping the order list - #2531
Draft
BullishNode wants to merge 1 commit into
Draft
fix(exchange): stop one unparseable order from wiping the order list#2531BullishNode wants to merge 1 commit into
BullishNode wants to merge 1 commit into
Conversation
The API legitimately sends order values the app refused to parse: status 'Expired' (distinct from 'Payment deadline expired'), payout status 'Failed', order type 'Sell USDT', empty payin/payout statuses, and null exchange rate and confirmation deadline fields on admin-initiated orders. Both batch parse layers turned the first such order into an empty list, hiding every exchange transaction in the app. - Parse per element with skip-and-log at both layers (datasource listOrderSummaries and repository getOrders), and in getOrderByTxId. - Make OrderStatus, OrderPayinStatus, OrderPayoutStatus and OrderType tolerant of unknown values; add the known missing members. - Render unknown order types generically via a new Order.generic variant carrying the server-sent type name. - Relax exchangeRateAmount, exchangeRateCurrency and confirmationDeadline to nullable, matching the server contract, with null guards at their consumers. - Read reward amounts from the payout side; the payin side is empty for admin-initiated orders and rendered every reward as 0 sats. - Derive fiat-vs-sats display from the order instead of a hardcoded variant list, fixing fiat refunds shown as sats and BTC balance adjustments formatted as fiat. Closes #2526 Closes #2527
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The API legitimately sends order values the app refused to parse: status
Expired(distinct fromPayment deadline expired), payout statusFailed, order typeSell USDT, empty payin/payout statuses, and null exchange-rate/deadline fields on admin-initiated orders. Both batch parse layers (datasourcelistOrderSummariesand repositorygetOrders) turned the first such order into an empty list, hiding every exchange transaction in the app. Confirmed in device logs:Error fetching orders — Exception: Unknown OrderStatus: Expired. Server contract verified against API-OrdersorderSummary.ts.Changes
getOrderByTxIdfromValueonOrderStatus/OrderPayinStatus/OrderPayoutStatus/OrderType; add missing members (Expired,Failed,Sell USDT)Order.genericvariant carrying the server-sent type nameexchangeRateAmount/exchangeRateCurrency/confirmationDeadlinenow nullable (matching the server), with guards at consumersValidation
15 new regression tests (poisoned-list survival at both layers, each new enum value, null fields, reward amount);
flutter analyzeclean; reviewed with a verification pass (2 should-fixes applied). Note: this branch touchesCountdownnull-guards in buy/pay/sell screens — minor line-disjoint overlap with the sibling fix PRs at merge.Closes #2526
Closes #2527