W11-C4: Non-terra1 garbage deep link shows silent empty state ;no error, no redirect, auto-navigate to first pair blocked #176

Closed
opened 2026-05-21 13:12:49 +00:00 by totdking · 13 comments
totdking commented 2026-05-21 13:12:49 +00:00 (Migrated from gitlab.com)
No description provided.
totdking commented 2026-05-21 13:16:10 +00:00 (Migrated from gitlab.com)

Issue Summary

Navigating to /trade/<anything> where the value does not start with terra1 renders a completely silent empty state. All three panels show "Select a pair" placeholders with no error or explanation. The garbage value in the URL state also blocks the normal auto-navigate fallback that would redirect the user to the first available pair.


Reproduction Steps

  1. Start the app (VITE_NETWORK=local npm run dev) with LocalTerra running
  2. Open http://localhost:3000/trade/lilwayne%20babyyy (any non-terra1 string)
  3. Observe the Trade page

Expected Behavior

Either:

  • Redirect to /trade/<first-pair> with an optional brief notice ("Pair not found — showing default"), or
  • Show a clear "Invalid pair link" message with a CTA to select a pair

In neither case should the garbage string remain in the URL and the page silently show three "Select a pair" empty states.


Actual Behavior

  • URL stays as-is — no redirect fires (the route /trade/:pairAddr matches, so the catch-all does not trigger)
  • All three panels render silent empty states:
    • Order book: "Select a pair to view the order book."
    • Chart: "Select a pair for the chart."
    • Order ticket: "Select a... — Choose a trading pair from the selector to place orders."
  • Pair selector displays "lilwayne babyyy" as the selected value
  • No API calls are made (queries correctly disabled, but silently)
  • Auto-navigate to the first real pair is blocked because the garbage string is truthy, satisfying the if (pairAddr || pairs.length === 0) return guard in TradePage.tsx

Screen record

Screen Recording 2026-05-21 at 14.13.45.mov{width=900 height=543}


Environment Details

Field Value
OS macOS (Apple M1 Pro, 14-inch)
Browser Google Chrome 148 (desktop)
Viewport ~1440px desktop
Network localterra (local Docker)
Frontend VITE_NETWORK=local npm run dev at localhost:3000

Wallet / Device Details

  • Wallet: Station browser extension
  • Wallet state: Connected — localterra

Severity / Impact

P2 Polish. No funds are at risk. A trader landing on a bad share link with a non-terra1 param sees what looks like a broken app — three empty panels, a garbage address shown in the selector, and no guidance on what happened or what to do. Found under W11-C4 (Wrong network deep link — Display, Updates, and Trader use dimensions).

cc: @PlasticDigits t

### Issue Summary Navigating to `/trade/<anything>` where the value does not start with `terra1` renders a completely silent empty state. All three panels show "Select a pair" placeholders with no error or explanation. The garbage value in the URL state also blocks the normal auto-navigate fallback that would redirect the user to the first available pair. --- ### Reproduction Steps 1. Start the app (`VITE_NETWORK=local npm run dev`) with LocalTerra running 2. Open `http://localhost:3000/trade/lilwayne%20babyyy` (any non-`terra1` string) 3. Observe the Trade page --- ### Expected Behavior Either: - Redirect to `/trade/<first-pair>` with an optional brief notice (_"Pair not found — showing default"_), or - Show a clear _"Invalid pair link"_ message with a CTA to select a pair In neither case should the garbage string remain in the URL and the page silently show three "Select a pair" empty states. --- ### Actual Behavior - URL stays as-is — no redirect fires (the route `/trade/:pairAddr` matches, so the catch-all does not trigger) - All three panels render silent empty states: - Order book: _"Select a pair to view the order book."_ - Chart: _"Select a pair for the chart."_ - Order ticket: _"Select a... — Choose a trading pair from the selector to place orders."_ - Pair selector displays `"lilwayne babyyy"` as the selected value - No API calls are made (queries correctly disabled, but silently) - Auto-navigate to the first real pair is blocked because the garbage string is truthy, satisfying the `if (pairAddr || pairs.length === 0) return` guard in TradePage.tsx --- ## Screen record ![Screen Recording 2026-05-21 at 14.13.45.mov](/uploads/5879ac56a683c9b3cc1a707ae4642fe9/Screen_Recording_2026-05-21_at_14.13.45.mov){width=900 height=543} --- ### Environment Details | Field | Value | |-------|-------| | OS | macOS (Apple M1 Pro, 14-inch) | | Browser | Google Chrome 148 (desktop) | | Viewport | \~1440px desktop | | Network | `localterra` (local Docker) | | Frontend | `VITE_NETWORK=local npm run dev` at `localhost:3000` | --- ### Wallet / Device Details - **Wallet:** Station browser extension - **Wallet state:** Connected — localterra --- ### Severity / Impact **P2 Polish.** No funds are at risk. A trader landing on a bad share link with a non-`terra1` param sees what looks like a broken app — three empty panels, a garbage address shown in the selector, and no guidance on what happened or what to do. Found under **W11-C4** (Wrong network deep link — Display, Updates, and Trader use dimensions). cc: @PlasticDigits t
totdking commented 2026-05-21 15:04:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #116

mentioned in issue #116
PlasticDigits commented 2026-05-22 05:48:09 +00:00 (Migrated from gitlab.com)

mentioned in commit fa74332671

mentioned in commit fa7433267158335b93b73389b5fd93ea153ed497
PlasticDigits commented 2026-05-22 05:48:30 +00:00 (Migrated from gitlab.com)

Fix shipped on main (fa74332)

Non-terra1 or malformed /trade/:pairAddr deep links no longer produce a silent three-panel empty state.

What changed

  • InvalidPairLinkNotice — role="alert" banner: Invalid pair link, quotes the bad segment, Select a trading pair CTA scrolls/focuses #trade-pair-select.
  • URL cleanup — replace navigate to /trade so garbage does not stay in the address bar.
  • Pair selector — pairAddr stays empty until the user picks a pair (selector no longer shows the raw invalid segment).
  • Query gating — indexer/LCD calls use isTradePairRouteParam (isValidTerraAddress) instead of bare startsWith('terra1').
  • Auto-pick — first factory pair redirect is suppressed while the invalid-link notice is visible.

Docs / agent playbooks

  • docs/frontend.md — § Trade page — invalid pair deep link (#trade-page-invalid-pair-link)
  • skills/AGENTS_FRONTEND_TRADE_INVALID_PAIR_LINK.md (cross-linked from trade layout + user-errors skills)

Verification checklist

  • Open http://localhost:3000/trade/lilwayne%20babyyy — alert visible, URL becomes /trade.
  • Pair selector trigger does not show lilwayne babyyy.
  • Select a trading pair focuses/opens the pair menu.
  • Order book / chart / ticket show normal empty copy (not a broken silent state).
  • No indexer pair/trades requests in Network tab for the garbage param.
  • Valid deep link /trade/<terra1-pair> still loads book, chart, and ticket.
  • npm test -- --run src/pages/TradePage.test.tsx src/utils/__tests__/tradePairRoute.test.ts passes.

@totdking — please verify on local (VITE_NETWORK=local) when you have a moment. Leaving this issue open until sign-off.

## Fix shipped on `main` (fa74332) Non-`terra1` or malformed `/trade/:pairAddr` deep links no longer produce a silent three-panel empty state. ### What changed - **`InvalidPairLinkNotice`** — `role="alert"` banner: **Invalid pair link**, quotes the bad segment, **Select a trading pair** CTA scrolls/focuses `#trade-pair-select`. - **URL cleanup** — `replace` navigate to `/trade` so garbage does not stay in the address bar. - **Pair selector** — `pairAddr` stays empty until the user picks a pair (selector no longer shows the raw invalid segment). - **Query gating** — indexer/LCD calls use `isTradePairRouteParam` (`isValidTerraAddress`) instead of bare `startsWith('terra1')`. - **Auto-pick** — first factory pair redirect is suppressed while the invalid-link notice is visible. ### Docs / agent playbooks - docs/frontend.md — § Trade page — invalid pair deep link (`#trade-page-invalid-pair-link`) - skills/AGENTS_FRONTEND_TRADE_INVALID_PAIR_LINK.md (cross-linked from trade layout + user-errors skills) ### Verification checklist - [ ] Open `http://localhost:3000/trade/lilwayne%20babyyy` — alert visible, URL becomes `/trade`. - [ ] Pair selector trigger does **not** show `lilwayne babyyy`. - [ ] **Select a trading pair** focuses/opens the pair menu. - [ ] Order book / chart / ticket show normal empty copy (not a broken silent state). - [ ] No indexer pair/trades requests in Network tab for the garbage param. - [ ] Valid deep link `/trade/<terra1-pair>` still loads book, chart, and ticket. - [ ] `npm test -- --run src/pages/TradePage.test.tsx src/utils/__tests__/tradePairRoute.test.ts` passes. @totdking — please verify on local (`VITE_NETWORK=local`) when you have a moment. Leaving this issue **open** until sign-off.
Brouie commented 2026-05-25 01:33:22 +00:00 (Migrated from gitlab.com)

verified fa743326 on QA stack.

source: isTradePairRouteParam in frontend-dapp/src/utils/tradePairRoute.ts rejects non-terra1 garbage via isValidTerraAddress regex (/^terra1[a-z0-9]{38,}$/).

tests: tradePairRoute.test.ts 4/4 PASS + TradePage.test.tsx 10/10 PASS, the "lilwayne babyyy" case is explicitly covered.

good to close on your side @PlasticDigits

verified `fa743326` on QA stack. source: `isTradePairRouteParam` in `frontend-dapp/src/utils/tradePairRoute.ts` rejects non-terra1 garbage via `isValidTerraAddress` regex (`/^terra1[a-z0-9]{38,}$/`). tests: `tradePairRoute.test.ts` 4/4 PASS + `TradePage.test.tsx` 10/10 PASS, the "lilwayne babyyy" case is explicitly covered. good to close on your side @PlasticDigits
Brouie commented 2026-05-25 01:35:06 +00:00 (Migrated from gitlab.com)

mentioned in issue #175

mentioned in issue #175
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-25 01:52:42 +00:00
Brouie commented 2026-06-11 02:07:03 +00:00 (Migrated from gitlab.com)

mentioned in issue #357

mentioned in issue #357
Brouie commented 2026-06-11 02:54:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #358

mentioned in issue #358
PlasticDigits commented 2026-06-11 15:27:02 +00:00 (Migrated from gitlab.com)

mentioned in merge request !865

mentioned in merge request !865
PlasticDigits commented 2026-08-17 03:45:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #541

mentioned in issue #541
PlasticDigits commented 2026-08-17 04:19:20 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1070

mentioned in merge request !1070
PlasticDigits commented 2026-08-26 04:15:27 +00:00 (Migrated from gitlab.com)

mentioned in issue #664

mentioned in issue #664
PlasticDigits commented 2026-08-26 04:16:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #665

mentioned in issue #665
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#176
No description provided.