Repository navigation
fix(dashdex): show a plain message when the coin list fails to load - #1375
Conversation
The coin picker labelled and offered coins from SwapKit's static /tokens lists, so a coin stayed selectable while neither NEAR nor Maya could route it, and the address screen then reported a 404 noRoutesFound as a connection problem. Probe each coin with a quote forced to one provider (about $50 of the sold asset, at most two requests in flight, cached): NEAR is checked on sentinel coins first and treated as down for every coin when they have no route; Maya is checked per coin. Both usable -> "Multiple", one -> that provider, none -> the existing halted row. Buy is included. The address screen reads the error body: a refused address keeps the address copy, a missing route is re-checked without the address, and only a transport failure says "check your connection". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: b74eae0efdd70d3ee1a0a80343f3a5dfc106651a
…hecks SDD-Published-From: ed9c59385523bdfdc167485480c5aced6e69ce52
…ecovery PR feedback round 10: - Re-check a no-route on the address screen at the address quote's amount without the address; a below-minimum there lets the holder continue instead of blaming the address (thread 4483087473). - A probe that returns after its coin got a newer answer no longer overwrites it (thread 4483087481). - When NEAR recovers, the other sentinels' no-routes from the outage are dropped so their coins are checked in the same refresh; a no-route from the recovery round itself is kept (thread 4483087490). - Tests for the re-check wiring, the stale probe and the recovery; ADR-0008 updated. SDD-Published-From: 6b816f1cd4a6a5863876e92346a3e486174c9838
…nswers - The address check counts a refusal only from a provider the quote asked for, so an unrequested provider's error cannot block a valid address. - The NEAR sentinel round reads the answers stored since it started, both to decide when to stop and for the verdict, so an older probe answer overtaken by a newer one (e.g. from the address quote) no longer declares NEAR down, and a no-route overtaken by a halt makes the round ask the third sentinel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: 9f2cf3bb437c434f74a7e704a00b72a71abbb30e
Develop took ADR-0006 for the App Connect decision and an open PR takes 0009, so the live-route ADRs move to 0010 (probes), 0011 (store) and 0012 (sentinels), per ADR-0001 rule 3. The decision index keeps develop's 0006 row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: 661ec85865014cb4590d9232a8f961da2d643585
Develop regenerated the string catalogs, so the swap service message is added to them again in their new order. The decision index keeps develop's 0009 row above the swap ADRs 0010-0012. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: f1c510a3c7d0c8acb65c7f38c7132b9f0f6b8b85
Review: a NEAR "down" verdict took its boundary from the clock when the sentinel round finished, so a coin's route recorded while the round was still asking was hidden as "no route". The verdict now keeps the sequence at the start of the round that first found the outage; a coin's answer asked or recorded after it wins, one from before it does not. Spec wording, ADR-0012 and tests pin both sides. QA: the coin picker showed "Status Code: 403, Data Length: 4545" and the exported logs held no trace of it. A failed coin-list load and a failed route check now log the HTTP status, the path and a short body excerpt (an HTML page by its title); NEAR verdict changes and sentinel rounds that settle nothing are logged too. No key, query or address is logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: af4a07dcbc494f1d6c12dff7d7162e7fc81926fb
Develop added ADRs 0007 and 0023-0026; the decision index keeps them beside the swap ADRs 0010-0012 and lists both new areas. Review: a picker closed while the round that finds a NEAR outage still waits on its last sentinel; the round still settles and a coin's route recorded meanwhile stays usable. A regression test pins it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: 5a607298ca6034ea4ff276829a239370d9d77705
A quote to the user's address that carried a route never looked at the provider errors, so a halted provider beside the route (Maya halted while NEAR routes) was not recorded; a route from one Maya flavour still outweighs the other flavour's halt. The swap live routes summary now words two guarantees as the code keeps them: an earlier conclusive answer keeps applying after an inconclusive re-check, and the address screen re-checks a "no route" outside the picker. Review round 26 on #1297: thepastaclaw 4525313507, CodeRabbit 4524711754 and 4524711764. SDD-Published-From: 8b5e623ae43ab4ee53a336d6576f9cba18f0dc42
Closes the PR #1297 review round of 2026-11-10 16:01Z: an older overlapping coin list load no longer commits its pools or starts route checks after a newer one (thread r4527231138); the address check passes only on a route a requested provider carries (r4527231147); the README states the halted, expiry and address guarantees as the code keeps them (r4527231218, r4526558156, r4526558173). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: ee3e6c411eeb6bb191b121b6cabaf1c629501ae0
When a quote records a route for the coin while the address screen's no-route re-check is asking, the re-check now reports that newer answer instead of its own older no-route (review: re-check ignores a newer stored answer). The README names every quote that sends the entered address (review: address claim overstated). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: 04e23df4567e99102ce7691bc0c5a7b9d60e3def
Select coin put the error's localizedDescription on screen, so a refused request showed "Status Code: 403, Data Length: 4545" to the user. It now shows "Couldn't load the coin list. Please try again, or try a different network."; the failure detail still goes to the log. Fixes #1371 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Pre-merge checks:
|
|
🔍 Review in progress — actively reviewing now (commit 0146122) · triage: low |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
Verified the base-to-head changes at c989616 and found no in-scope issues. The picker displays localized recovery guidance while retaining diagnostic logging, retry behavior, and stale-request protection; all 43 catalog changes are limited to the intended addition. Validation was static, with no local builds or tests run; current CI passes simulator tests, target membership, workflow lint, and accessibility checks on this head, with only the automated review pending.
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff makes a small, contained behavioral change to coin-list error presentation, with a focused regression test, localization entries, and screenshots, without changing transaction or networking logic. - Phase 1 reviewers: not run (skipped for throughput: 11 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer
llbartekll
left a comment
There was a problem hiding this comment.
Approving. The change is small and does what it says: every coin-list load failure now shows one localized message, the cause still goes to the log through SwapKitFailureDetail (#1297), and the stale-generation guard runs before errorMessage is set, so a late failure can't overwrite a newer load. Retry (loadCoins(force: true)) and the offline skip are unchanged.
What I checked:
SelectCoinViewModel.loadCoins: thecatchis the only placeerrorMessagegets a value, so nothing else in the picker can still show raw HTTP text.- The test calls the real
loadCoins()with aLocalizedErrorwhose text matches the client's non-2xx description, throughScriptedPoolsProvider.fetchPools(direction:). If the line went back toerror.localizedDescription, the test would fail. - All 43
Localizable.stringscatalogs: each has the key exactly once, andplutil -lintpasses on every one. - CI on
c989616f: unit tests, target membership, accessibility and workflow lint are all green.
Non-blocking:
- Wording: see the inline comment on "try a different network".
- Follow-up, out of scope here:
OrderPreviewViewModelstill sendserror.localizedDescriptionto the user insetFailure(...)andpendingSwapAlertMessage(around lines 339, 403, 443–455). A non-2xx answer on the quote or order path would probably show the same "Status Code: …" text there. That might be worth its own issue.
Merge order: this is stacked on #1297, which currently has CHANGES_REQUESTED. Retarget to develop after #1297 merges, as the description says.
I only read the code and checked CI. I didn't run it locally.
|
|
||
| /// What the picker shows when the coin list fails to load; the cause goes to the log. | ||
| static let loadFailedMessage = NSLocalizedString( | ||
| "Couldn't load the coin list. Please try again, or try a different network.", |
There was a problem hiding this comment.
Nit, non-blocking: on this screen "network" could also mean a chain. The picker labels each coin with its routing network ("Maya", "NEAR", "Multiple networks" from networkLabels), so "try a different network" might read as "pick a coin on another chain". If the intent is the internet connection (the edge refusing based on where the request comes from), something like "…or try a different internet connection (Wi‑Fi or mobile data)" would be clearer. Changing it means updating the key in all 43 catalogs, so it's fine to leave as is.
# Conflicts: # DashWallet/Sources/UI/Swap/SelectCoin/SelectCoinViewModel.swift # DashWalletTests/SelectCoinViewModelTests.swift
Issue being fixed or feature implemented
Fixes #1371. When the Dash DEX coin list fails to load, Select coin shows the error's
localizedDescription. For a non-2xx answer that is the HTTP client's response description, so the user sees "Status Code: 403, Data Length: 4545" with an empty "Error:" line under it. This was seen on a TestFlight build when the edge in front of the SwapKit API refused/swapTowith an HTML page; any other load failure (timeout, 5xx, decoding) reaches the user the same way.Stacked on #1297, which changes the same
catchinSelectCoinViewModel.loadCoins. Retarget todeveloponce #1297 merges.What was done?
SelectCoinViewModel.loadCoinsnow putsloadFailedMessageinerrorMessageon any load failure: "Couldn't load the coin list. Please try again, or try a different network." Retry stays below it. The failure detail (status, path, HTML title or JSON excerpt) still goes to the app log throughSwapKitFailureDetailfrom fix(dashdex): show which provider can swap each coin right now #1297.Captured on the iPhone 17 simulator (Debug, mainnet) with an invalid SwapKit key, so
/swapToanswers 401 — the same failure path as the 403 seen on TestFlight.How Has This Been Tested?
SelectCoinViewModelTests.testAFailedLoadShowsAPlainMessage: a pool fetch that fails with a "Status Code: 403, …" error leaves the plain message, not the HTTP text. It failed before the change and passes after it.SwapRouteAvailabilityTests,SwapKitQuoteDecodingTests,SwapKitQuoteBoundaryTests,SwapKitErrorCopyTests,SwapKitFailureDetailTests,SwapAddressValidatorTests,SelectCoinViewModelTests,BuySwapOrderTests), 199 tests, pass on the iPhone 17 simulator (dashwallet-dashpay, Debug). SwiftLint reports no new findings on the changed Swift files; the accessibility check is clean.API_KEYin the localSwapKit-Info.plist(or map/swapToto a 403 in a proxy), open Dash DEX → Sell → Select coin, and expect the message above with Retry; this is how the captures above were made.Breaking Changes
None.
Checklist:
not needed: N3For repository code-owners and collaborators only
.xcode-versionchanged, or a.platform-refbump changed platform's Rust version, I ran the affected workflow by hand from this branch on the final commit (release-dashpay-testflight.ymlwithwallet_ref= that commit andrelease_channel: internal-only;appstore-schema-release.ymlwithdry_run: true) and linked the run here; a later push needs a new run🤖 Generated with Claude Code