fix(trade): preserve deep-link notices across Layout keyed-Outlet remount (#358) #865
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!865
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/358-trade-notice-layout-remount"
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 #358: unknown/invalid
/trade/:pairAddrdeep-link notices were wiped whenTradePagenavigated to bare/trade, becauseLayout.tsxkeys<Outlet>onlocation.pathname(#138/#182) and remounts the route subtree.Change: carry notices in router
location.state(invalidPair/unknownPair) vianavigate('/trade', { replace: true, state: … })instead of componentuseState. State survives the pathname-keyed remount; auto-pick stays blocked while a notice is present.Acceptance checklist
/tradewith noticenpm test -- --run src/pages/TradePage.test.tsx—keeps pair-not-found notice after Layout keyed-Outlet remount/tradewith noticekeeps invalid pair link notice after Layout keyed-Outlet remountpairs[0]while notice active/trade, not/trade/<PAIR>npm test -- --run src/pages/TradePage.test.tsx src/utils/__tests__/tradePairRoute.test.ts(31 tests)keeps non-default deep link after factory pairs resolvein same suitedocs/frontend.md,skills/AGENTS_FRONTEND_TRADE_INVALID_PAIR_LINK.mdThird-party verification
Manual (with
make dev+ deploy env):/trade/terra1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxin a fresh tab → URL settles on/trade, Pair not found notice visible, pair selector empty, no workspace./trade/lilwayne%20babyyy→ URL settles on/trade, Invalid pair link notice visible./trade/<known-non-default-factory-pair>→ stays on requested pair (#357).Closes #358 when merged.
changed the description
changed the description
Security review
Commit reviewed:
a52c9e2ec6f76d281792a918b06b37734e53045aScope: Trade deep-link notice persistence via React Router
location.state(TradePage.tsx,tradePairRoute.ts, tests, docs/skills).Outcome:
FINDINGS: 0medium+Summary
Reviewed attacker-controlled input paths for the new
invalidPair/unknownPairlocation-state carriers:TradePageaftergetInvalidTradePairRouteParam/getUnknownTradePairRouteParam/ indexer-not-found handling on/trade/:pairAddr. Same validation as the prioruseStateapproach; only the persistence layer changed./tradevisits —location.stateis not URL-serializable; cold loads cannot receive forged notice payloads from an external link without same-origin script execution (out of scope for this diff).InvalidPairLinkNotice/PairNotFoundLinkNoticeinterpolate notice text in JSX text nodes (nodangerouslySetInnerHTML). React escaping applies; invalid segments may contain arbitrary characters from the path segment, but this predates the MR and is not worsened by location state.shouldShowTradeWorkspace/shouldAutoPickDefaultTradePair; they do not setpairAddror contract call targets. No authn/authz, secret, SSRF, or dependency changes in this diff.No inline threads — nothing to flag at medium or higher severity.
Security review: no medium+ findings on this diff.
mentioned in commit
cf275720efmentioned in issue #358