UI: Trade page pair selector reverts to EMBER/CORAL after selecting a different pair #350
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#350
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?
Summary
On the
/tradepage, the pair selector dropdown opens correctly when clicked and displays available pairs. However, selecting any pair other than the default EMBER/CORAL causes the selector to immediately revert back to EMBER/CORAL. The selected pair is not retained and the trade panel does not update to reflect the new pair.Reproduction steps
/tradeon LocalTerraExpected behavior
Selecting a pair from the dropdown should update the trade panel to show order book, price, and order ticket for the newly selected pair. The selector should retain the chosen pair.
Actual behavior
The dropdown closes after selection but the pair immediately reverts to EMBER/CORAL. No state change is persisted. The user cannot trade any pair other than the default on this page.
Impact assessment
Environment
/tradeSeverity: ~"blocker:hybrid" -- users cannot switch pairs on the trade page.
ref to https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/301 still prevalent, found during exploratory testing of VP-4 of checklist https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/291
cc: @PlasticDigits
Triaged this from source + git history + the unit layer (browser re-check is batched for my next frontend pass).
Good news first: this is NOT the #301 fix regressing. TradePage.tsx hasn't been touched since the PairSearchSelect change landed, nothing in the recent wave goes near the selector files, and the #301 regression tests (the real portal-click path) are green at
83dc192. The mouse-click flow is correct at current main.But there IS a deterministic bug at current main in the type-then-Enter flow, and it produces exactly this symptom:
Proved it at the unit layer: a test that types a query whose hits exclude the current pair, waits for results, presses Enter, and asserts onChange gets the search hit — fails on main, onChange receives the CURRENT pair instead. Deterministic, not a race. Happy to hand over the repro as a regression test once the fix shape is decided.
Two things make this nastier right now:
5e32012). The bug is that the same prepend+reset wins while a typed query is active. Fix direction: when debouncedSearch is non-empty, land the highlight on the first search hit (or skip the current-pair prepend for typed queries) so Enter commits what the user searched for.@totdking two things to confirm from your side, since your repro steps read like a mouse-click flow (which tests green at main): did you select by clicking the option, or type + Enter? And what build is your frontend on (git rev-parse HEAD)? Heads up — the repo history got rewritten, so a plain git pull leaves a stale/diverged clone; you need git fetch && git reset --hard origin/main. If your build predates the PairSearchSelect combobox you'd literally be re-testing the old #301 control.
@PlasticDigits flagging because the type+Enter path above is a real current-main bug whichever way the original repro was hit, and this issue is tagged blocker so it gates the LR-00 sign-off.
mentioned in issue #354
mentioned in issue #355
Refinement on my note above, from continuing the browser pass on a real client: "the mouse-click flow is correct at current main" is true of the SELECTOR logic, but click-switching still fails one layer later in a live browser — the workspace prefetch seeds a flat limit-book page into the query key the order-book panel consumes as an infinite query, and the trade view crashes to the ErrorBoundary when the panel renders. Filed with the full mechanism as #354.
Separately, the book endpoints throw real 429s under normal single-user usage because of the lcd-heavy limiter's semantics — filed as #355.
So this control currently has three distinct failure modes: the type+Enter default-revert (above), the click-switch crash (#354), and rate-limit starvation degrading the book (#355). Which one a repro hits depends on input method and limiter state — worth re-testing VP-4 only after #354/#355 land.
@totdking the build-sha + input-method questions above still stand, mostly to know which of the three you saw.
mentioned in issue #337
mentioned in commit
b0f83914b1MR !853 on
local1/350-impl-enter-commit-search-hit. Type+Enter now commits first search hit. Click-switch depends on #354; book 429s on #355.mentioned in merge request !853
mentioned in commit
fda7cc5e37Verified the merged fix (!853, commit
b0f8391) at source + unit-test layer one198dcb. The two mechanisms I flagged are both fixed in PairSearchSelect.tsx: the current-pair prepend is now gated by !debouncedSearch, and the activeIndex reset effect sets index 0 (first hit) when a query is active instead of parking on the prepended current pair. The new regression test PairSearchSelect.issue350 passes, and traced againstb0f8391^ it would have failed (old code commits the current pair on type+Enter). Full PairSearchSelect suite 7/7. Browser/keyboard re-test is the laptop layer, in progress.mentioned in issue #357
mentioned in issue #481
mentioned in issue #542
mentioned in issue #562
mentioned in issue #632
mentioned in merge request !1144