fix(swap): do not treat route/solve 400 as market-data outage (#326) #800
No reviewers
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!800
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-b0ae"
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
Fixes https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/326
When the indexer is healthy but
GET /api/v1/route/solvereturns 400 (e.g. router simulation failed on a fresh deploy), the swap page incorrectly showed "Market data service unavailable." — the same banner as a genuine transport outage.Root cause:
isIndexerUnavailableErrortreated anyIndexer API error:message as outage, excluding only 404.Fix: Add
isIndexerClientError(all indexer 4xx) and exclude it from outage detection. Outage now means network/AbortError/Failed to fetchor 5xx only. The swap page already falls back to client-side BFS + LCD sim when route/solve fails; with this change the fallback no longer setsindexerTransportFailedfor 400s and the outage banner stays hidden.Acceptance checklist
/route/solveis not classified as transport outagenpx vitest run src/utils/__tests__/indexerErrors.test.tsdetectMarketDataOutageignores 400npx vitest run src/utils/__tests__/marketDataOutage.test.tsdetectSwapIndexerOutageignores 400npx vitest run src/utils/swapIndexerOutage.test.tsnpx vitest run src/pages/SwapPage.test.tsx(GitLab #326 case)SwapPage.test.tsx#241 casesmake test-frontend(843 tests)make lint-frontendVerification for third parties
Optional manual QA (fresh deploy):
make setup-cloud-localterra(or existing QA stack with indexer running)/→ select a pair that triggers route/solve 400 before pool sync settlesswap-market-data-outage-banner; swap quote may still appear via LCD fallbackDocs
skills/AGENTS_FRONTEND_MARKET_DATA_OUTAGE.md— 4xx vs outage ruledocs/frontend.md— swap outage invariants updated for #326Issue left open until merge.
changed the description
changed the description
mentioned in issue #326
changed the description
Security review
Commit reviewed:
df9b9e54a5fab95d97cdcdff76413cd0fea00f77Scope: Frontend outage classification for indexer HTTP errors —
isIndexerClientError(4xx), narrowedisIndexerUnavailableError(transport + 5xx), docs/skills, Vitest (indexerErrors,marketDataOutage,swapIndexerOutage,SwapPage#326).Method: MR diff + sink tracing (
fetchJson→ error strings →detectMarketDataOutage/detectSwapIndexerOutage/SwapPageindexerTransportFailed/ CTA gates). Checked injection, XSS via error copy, stale-quote / swap-without-sim paths, and authz/outage bypass via status spoofing.Outcome:
FINDINGS: 0medium+Inline threads: None (no qualifying findings).
Notes (informational, below reporting threshold)
simQuerywith LCD/simulate_swapdata (simDatacleared onsimQuery.isError; CTA stays Quote unavailable when sim fails).resp.statusembedded inIndexer API error: ${status} …fromclient.ts; user-facing paths usehumanizeUserFacingErrorFromUnknown/sanitizeOpaqueErrorMessage.Automated security review (Cursor Cloud Agent).
mentioned in commit
e269c0ec85