UI: Swap — "Market data service unavailable" banner fires on 400 from /route/solve; healthy-indexer route-simulation failures misclassified as transport outage #326
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#326
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When the indexer is running and reachable but
/api/v1/route/solvereturns a400 Bad Request(e.g."router simulation failed for the given route and hybrid parameters"), the swap page displays the "Market data service unavailable." banner. This is the same banner shown when the indexer is genuinely unreachable. The banner disappears when the indexer is stopped entirely — the inverse of the message it shows.The root cause is that
isIndexerUnavailableErrorclassifies any"Indexer API error:"message (all non-2xx, non-404 status codes) as a transport outage. A 400 from a healthy indexer is a semantic / route-simulation error — the service is available, the specific route failed.Root cause (code verified)
client.ts:43–44— all non-OK responses become"Indexer API error: <status>":A 400 from
/route/solvethrows"Indexer API error: 400 Bad Request".indexerErrors.ts:7–13—isIndexerUnavailableErrorcatches this:The function excludes 404 (pair not found) but does not exclude other 4xx codes. A 400 is treated as an unreachable service.
marketDataOutage.ts:9–11→swapIndexerOutage.ts:13→SwapPage.tsx:595:Because
simQuery.isError = trueandisIndexerUnavailableErrorreturnstruefor the 400,indexerOutagebecomestrueand the banner fires.The 404 special-case precedent:
isIndexerPairNotFoundErroralready correctly excludes 404 (pair not in catalog) from the outage classification. The same treatment is needed for 400 (route simulation failed, semantic error from a healthy service).Steps to reproduce
make start-qaormake deploy-local && make indexer-dev//route/solve400 errors stopExpected behavior
A 400 response from
/api/v1/route/solveshould be classified as a route-simulation failure, not a service outage. The swap page should either:The "Market data service unavailable" banner should only appear when the indexer is genuinely unreachable (network error,
AbortError,Failed to fetch, or 5xx).Actual behavior
Any
400 Bad Requestfrom/route/solve— a healthy indexer responding to an unresolvable route — triggers the outage banner. The banner implies service downtime when the service is up and responding. The error is transient (resolves after pool sync completes on a fresh deploy) but during that window users see a misleading outage state.Screenshot
Environment
/(Swap)make reset-qa/make deploy-local"router simulation failed for the given route and hybrid parameters"Severity: P3(Nit) no funds at risk and swaps may still succeed via LCD fallback, but the banner falsely declares the market data service down during a window when it is healthy. Particularly misleading on fresh deploys where this is the first state a tester or user encounters.
cc: @PlasticDigits
mentioned in commit
df9b9e54a5mentioned in merge request !800
Implementation complete
MR: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/82
Changes
isIndexerClientErrorinindexerErrors.ts— all indexer 4xx are semantic/client errors, not transport outageisIndexerUnavailableErrornow excludes 4xx (404 pair-not-found unchanged; 400 route-solve simulation failure no longer triggers banner)noteIndexerFailure/indexerTransportFailedpath inherits the fix automaticallyskills/AGENTS_FRONTEND_MARKET_DATA_OUTAGE.md,docs/frontend.mdVerification
indexerErrors.test.ts)detectMarketDataOutageignores 400detectSwapIndexerOutageignores 400make test-frontend(843 tests)make lint-frontendIssue remains open pending MR merge.
mentioned in commit
e269c0ec85mentioned in merge request !798
mentioned in issue #485