W11-C4: Invalid terra1 deep link accepted as a valid pair — spinner and ambiguous 404, no "pair not found" feedback #175
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#175
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?
Issue Summary
Navigating to
/trade/terra1<garbage>passes thestartsWith('terra1')guard in TradePage and loads the full trade UI. The order book spins indefinitely, the chart panel shows a generic "not indexed yet" message, and the pair selector displays the garbage address as if it were a valid selection. There is no indication that the address in the URL is invalid.Reproduction Steps
VITE_NETWORK=local npm run dev) with LocalTerra runninghttp://localhost:3000/trade/terra1damThat'scrazy(or any garbage string starting withterra1)Expected Behavior
The UI should detect that the address is not a known pair and show a clear message — e.g. "Pair not found. Select a pair from the list or check the link." The pair selector should not display the garbage address as a selected value.
Actual Behavior
127.0.0.1:3001), 500s from the LCD (localhost:1317)Screen record
Environment Details
localterra(local Docker)VITE_NETWORK=local npm run devatlocalhost:3000make indexer-dev)make deploy-localWallet / Device Details
Console Logs
Severity / Impact
P2 Polish. No funds are at risk and no transaction can be submitted from an unresolved pair. However, the full UI loading with an indefinitely spinning order book and a generic "not indexed yet" message makes it impossible for a trader to distinguish a broken share link from a real pair that happens to be missing from the indexer. The pair selector accepting and displaying the garbage address compounds the confusion. Found under W11-C4 (Wrong network deep link — Display and Trader use dimensions).
mentioned in issue #116
verified
fa743326(#176 fix) covers this case.source:
isValidTerraAddressregex/^terra1[a-z0-9]{38,}$/rejectsterra1damThat'scrazybecause the uppercaseTand apostrophe fail the[a-z0-9]charset.tests:
tradePairRoute.test.ts+TradePage.test.tsx14/14 PASS. literal repro string not in the test file but the regex catches it.note: the regex is format check, not bech32 checksum. lowercase 38+ char garbage like
terra1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwould still pass and hit the indexer. want a sibling filed for the deeper edge case, or accept as out-of-scope for #175 close?@PlasticDigits
@Brouie We shouldnt do a bech32 checksum as users may enter lowercase into the url, however we do need to show a pair/token not found error if its not in the indexer
mentioned in commit
ba97e3a212Fix landed on
main(407a74c)Per @PlasticDigits: no bech32 checksum on URL segments (lowercase paste is fine). Unknown pairs are gated on the factory pair list after
isValidTerraAddressformat check — not on indexer 404 storms.What changed
PairNotFoundLinkNotice— title Pair not found, quotes the deep-link segment, CTA focuses#trade-pair-select.TradePage— only setspairAddrwhenroutePairis ingetAllPairsPaginated()results; unknown valid-format links clear the URL to/trade, block auto-pick, and skip indexer/LCD workspace queries.getUnknownTradePairRouteParam,isKnownFactoryTradePairintradePairRoute.ts.skills/AGENTS_FRONTEND_TRADE_INVALID_PAIR_LINK.md.Split from #176
terra1damThat'scrazy,lilwayne babyyyterra1+ 38×xVerification checklist
http://localhost:3000/trade/terra1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx→ Pair not found alert, URL becomes/trade, selector empty (then auto-pick or manual select).http://localhost:3000/trade/terra1damThat'scrazy→ Invalid pair link (no indexer 404 spam).npm testinfrontend-dapp:TradePage.test.tsx+tradePairRoute.test.tspass.@brouie — please verify on localterra when you have a moment. Leaving the issue open until confirmed.
got it on no bech32 - leaving regex format check as-is. #175 good to close from QA side.
on the indexer-not-found requirement: confirmed the gap on QA stack. TradePage at line 266-279 only branches on
invalidLinkNotice(format-fail) andindexerDown(outage). whengetPairresolves with no pair on a valid-format address, neither fires - page falls through to empty trade UI. logging for followup.@PlasticDigits
mentioned in commit
d644e3c4d3Follow-up fix on
main(d644e3c)Addresses QA note: valid-format deep links could still show an empty trade workspace (book/chart/ticket with no
getPairdata) when only Invalid pair link / indexer outage banners were wired — neither applied once the route was valid-format but the pair was missing.What changed
shouldShowTradeWorkspace— book/chart/ticket mount only when a factory pair is selected and no invalid/unknown link notices are active.isPendingTradePairRouteResolution— while the factory list is still loading, do not render the workspace for a valid-format/trade/:pairAddrdeep link.isIndexerPairNotFoundError— indexer 404 ongetPairfor a segment not on the factory list syncsPairNotFoundLinkNotice(fallback for race/stale state).skills/AGENTS_FRONTEND_TRADE_INVALID_PAIR_LINK.mdVerification checklist
http://localhost:3000/trade/terra1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx→ Pair not found alert, URL/trade, no empty order book/chart/ticket shell behind the notice.http://localhost:3000/trade/terra1damThat'scrazy→ Invalid pair link (no indexer spam).cd frontend-dapp && npm test -- --run src/pages/TradePage.test.tsx src/utils/__tests__/tradePairRoute.test.ts src/utils/__tests__/indexerErrors.test.ts— 23/23 pass.@brouie — please verify on localterra when you can. Leaving the issue open until confirmed.
qa cleared per checklist @PlasticDigits
verified
d644e3cis on main (pulled).Tests 23/23 PASS:
Browser walk on local stack:
Items 2 (valid-format URL during slow factory list → skeleton/selector only) and 4 (known pair + indexer pair-metadata miss → workspace stays, chart Retry) — covered by the new indexerErrors + tradePairRoute unit cases; not separately simulated in the browser.
good to close.
mentioned in issue #357
mentioned in issue #358
mentioned in merge request !865
mentioned in issue #541
mentioned in issue #664
mentioned in issue #665