Skip to content

fix(dex): surface best_orders failures; CTA to Maker; localized empty states#3328

Merged
CharlVS merged 1 commit intotweak-prelogin-orderbookfrom
fix/order-book-retry
Oct 31, 2025
Merged

fix(dex): surface best_orders failures; CTA to Maker; localized empty states#3328
CharlVS merged 1 commit intotweak-prelogin-orderbookfrom
fix/order-book-retry

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Oct 31, 2025

This PR addresses best_orders error handling and improves UX for empty orderbooks.

Changes

  • Propagate best_orders failures (no longer masked as empty).
  • Map P2P "No response from any peer" (including wrapped Exception text) to "no orders" so the UI shows an empty state instead of an error.
  • Add debug-only failure simulator gated by app_config.dart toggles (kSimulateBestOrdersFailure, rate configurable).
  • Taker: show CTA to create a Maker order when no swap offers are available.
  • Bridge: show CTA when no cross-network routes are available.
  • Add locale keys: dexNoSwapOffers, bridgeNoCrossNetworkRoutes and wire them in the UI.

Other

  • Keep best_orders disabled outside Swap/Bridge pages.
  • Maintain retry logic already present in Mm2Api.

Screenshots

image image

NB!

Disable the failure simulator before merge.

Please review error mapping and copy.

- Propagate errors from best_orders instead of returning empty results
- Treat P2P 'No response from any peer' (including wrapped Exception) as no orders
- Add debug-only failure simulator toggled via kSimulateBestOrdersFailure

feat(ui): CTA to Maker when no orders; contextual localized messages

- Taker: show CTA when no swap offers available
- Bridge: show CTA when no cross-network routes exist
- Add locale keys: dexNoSwapOffers, bridgeNoCrossNetworkRoutes
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 31, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/order-book-retry

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CharlVS CharlVS requested review from ca333 and smk762 October 31, 2025 16:09
@CharlVS CharlVS self-assigned this Oct 31, 2025
Copy link
Copy Markdown
Collaborator

@smk762 smk762 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@CharlVS CharlVS merged commit f52a907 into tweak-prelogin-orderbook Oct 31, 2025
3 of 7 checks passed
@CharlVS CharlVS deleted the fix/order-book-retry branch October 31, 2025 16:48
CharlVS added a commit that referenced this pull request Nov 3, 2025
…ty (#3328)

- Propagate errors from best_orders instead of returning empty results
- Treat P2P 'No response from any peer' (including wrapped Exception) as no orders
- Add debug-only failure simulator toggled via kSimulateBestOrdersFailure

feat(ui): CTA to Maker when no orders; contextual localized messages

- Taker: show CTA when no swap offers available
- Bridge: show CTA when no cross-network routes exist
- Add locale keys: dexNoSwapOffers, bridgeNoCrossNetworkRoutes
@CharlVS CharlVS linked an issue Nov 4, 2025 that may be closed by this pull request
@smk762 smk762 mentioned this pull request Nov 23, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Direct users to maker form upon best_orders P2PError

2 participants