Trade page: unknown/invalid deep-link notices wiped by the Layout keyed-Outlet remount — unknown links silently land on the default pair #358
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#358
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?
Real-browser behavior at
3169af0(fresh tab, address bar): /trade/ ends at /trade/<pairs[0]> (EMBER/CORAL) with NO pair-not-found notice. Documented behavior (docs/frontend.md trade-page-unknown-pair-link, the #175 acceptance): notice + URL parked at bare /trade + auto-pick blocked.Root cause — not the #357 fix, and not the route structure:
<Outlet key={location.pathname} />(f07a71c, #138/#182). TradePage's own cleanup navigate('/trade', {replace:true}) in the unknown branch changes the pathname -> key flips -> React remounts the whole route subtree -> unknownPairNotice (plain useState, TradePage.tsx:112) is wiped.Timeline — silent regression from
f07a71c, not a #175 implementation bug:87b24d9(#176 invalid notice), 3ff34a5/00ae799 (#175 unknown notice) — both worked in the browser when verified;f07a71clanded one day after #175 and broke both flows.#357 is unaffected: the
1aeaf2cguard evaluates identically pre/post on this path (probed ate198dcband3169af0), and the known-pair deep-link fix verified clean in the browser.Fix direction, smallest diff first:
<Outlet key={location.pathname} />and assert the settled final pathname AND notice visibility. The flat-router #175/#176 tests cannot see this.Not launch-class like #357 was — every pair stays tradeable — but it voids the #175/#176 notice acceptance in production builds.
mentioned in issue #357
mentioned in commit
a52c9e2ec6mentioned in merge request !865
mentioned in commit
cf275720efVerified the fix (
a52c9e2/ !865) at the source + unit layer on16e0656.Root cause matches the writeup: the notices were plain useState, wiped when TradePage's own navigate('/trade') flips Layout.tsx's
<Outlet key={location.pathname}>and remounts the subtree. The fix carries them in router location.state viagetTradePageInvalidLinkNotice/getTradePageUnknownPairNotice, so they survive the remount — and the auto-pick effect now bails while a notice is present, which blocks the third mount that used to snap to pairs[0].Regression test is Layout-parity: it renders the trade routes under a parent doing
<Outlet key={location.pathname}>, drives an unknown deep-link and an invalid one, and asserts the settled pathname stays /trade (not /trade/) AND the notice stays in the document. That's the structural gap the flat-router #175/#176 tests couldn't see. Both new tests time out against the pre-fix TradePage (useState wiped) and pass at HEAD — proper pre/post proof.Covers the #175/#176 notice acceptance at the unit layer. Only thing left from my side is the real-browser final-URL recheck (incl. the invalid flow the issue called out) — that's on my laptop queue. Good to close on the src+unit layer once that browser pass rides along.
mentioned in issue #337
Verification complete — PASS
Verified fix at
8408689(merged via !865 /a52c9e2).Root cause (confirmed)
TradePagestored invalid/unknown pair notices in componentuseState. Navigating to bare/tradechangedlocation.pathname, which remounted the route subtree viaLayout.tsx<Outlet key={location.pathname} />, wiping the notice. A fresh mount at/tradethen auto-pickedpairs[0].Fix (confirmed)
Notices are carried in router
location.state(invalidPair/unknownPair) vianavigate('/trade', { replace: true, state: … })and read withgetTradePageInvalidLinkNotice/getTradePageUnknownPairNotice. Auto-pick bails while a notice is present.Automated — PASS
keeps pair-not-found notice after Layout keyed-Outlet remountkeeps invalid pair link notice after Layout keyed-Outlet remount/trade(not/trade/<default>)tradePairRoutelocation-state helpersdocs/frontend.md,skills/AGENTS_FRONTEND_TRADE_INVALID_PAIR_LINK.mdBrowser (Playwright Chromium against
make dev+ LocalTerra deploy) — PASSStack:
make setup-cloud-localterra→make devonhttp://127.0.0.1:5173./trade/terra1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx→ URL/trade, Pair not found notice visible, no workspace/trade/lilwayne%20babyyy→ URL/trade, Invalid pair link notice visible/trade/terra1nc84knc0n7td5xqplwy0luh97zd8hv5mhvm9cdempc05xk0xvxyqjr6cyg(non-default factory pair) stays on requested pair, workspace loadsSKIP
None.
Closing — acceptance met at src + unit + browser layers.
mentioned in issue #665