Fix: /limits book Edit drops orderId — no update path (GitLab #294) #312
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#312
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?
Current codebase
Trade page (correct):
TradePage.tsxpasses book-row Edit drafts viapushLimitBookDraft→TradeOrderTicket.tsx. On consume, it setseditContextviabuildLimitBookEditContext(limitBookDraft)includingorderId, enabling price-onlyUpdateLimitOrderPricethroughuseLimitOrderUpdatePriceMutation.Limits page (broken):
LimitOrdersPage.tsxlines 202–206:LimitBookTicketDraft(types/limitBookTicketDraft.ts) includesorderId,expiresAt,hintAfterOrderIdfor edit/amend flows (#162, #178, #247). The Limits page dropsorderIdand has noeditContext, nouseLimitOrderUpdatePriceMutation, and submit only callsplaceMutation→placeLimitOrderWithAllowance(always a new order).Follow-up: GitLab #294.
Why this is needed
Users editing a resting order from the book on
/limitsunknowingly place a duplicate order instead of amending price. This is a functional regression vs/tradeand wastes escrow/gas; cancel cleanup is manual.Constraints / guardrails
updateLimitOrderPricewhen only price changed (same gates asTradeOrderTicket.tsx).hintAfterOrderIdadvisory hint must flow to update mutation when amending.Relevant files
frontend-dapp/src/pages/LimitOrdersPage.tsxfrontend-dapp/src/components/trade/TradeOrderTicket.tsxfrontend-dapp/src/types/limitBookTicketDraft.tsfrontend-dapp/src/utils/limitOrderPriceEdit.tsfrontend-dapp/src/hooks/useLimitOrderUpdatePriceMutation.tsfrontend-dapp/src/services/terraclassic/pair.ts(updateLimitOrderPrice)frontend-dapp/src/components/trade/OrderBookPanel.tsxfrontend-dapp/e2e/trade-book-edit-178.spec.ts(Trade only today)Recommended direction
editContext,editHintAfterOrderId,isPriceOnlyLimitEdit,updatePriceMutation.onPrefillLimitTicketFromBookto callbuildLimitBookEditContext(draft)and set hint.updatePriceMutation; else existing place flow or explicit “cancel and replace” UX.Acceptance criteria
/limitsprefill shows “Editing order #N”.UpdateLimitOrderPrice, notplace_limit_order.orderIdpreserved through prefill; no duplicate order on price amend.orderId.Test plan (all paths)
placeMutationunchangedAttack / abuse / hack vectors
Verification criteria
make test-frontendgreen./limitsbook Edit → price amend → single order id on LCD.limit-orders-editanalogous totrade-book-edit-178.spec.ts.marked as related to #294
mentioned in commit
0a1810e959mentioned in merge request !791
Implemented fix in !791 — https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/73
What changed
/limitsnow mirrorsTradeOrderTicketbook-edit flow:buildLimitBookEditContexton prefill, price-only submit viaUpdateLimitOrderPrice, and block/replace messaging when side/amount/expiry change.Verification
make test-frontend— PASS (832 tests)npm run test -- src/pages/LimitOrdersPage.test.tsx— PASS (9 tests, 4 new for #312)/limits— SKIP (needs LocalTerra wallet QA)Issue left open pending MR merge and optional manual QA.
mentioned in commit
13422e60c4mentioned in issue #294