UI: wrap mapper rate limit disables submit button with no inline alert or copy [SEC-I05] (F04) #463
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#463
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
When the wrap mapper rate limit is exceeded,
SwapPage.tsxdisables the submit button with the label "Daily wrap limit exceeded" but does not render an inline alert block explaining the situation or offering guidance. The indexer 429 case surfaces a user-visibleINDEXER_RATE_LIMIT_RETRY_MESSAGEbanner viahumanizeOffChainError.ts, but the wrap mapper rate limit state has no equivalent visible feedback below the button. A user who hits this limit sees a disabled button with no explanation visible on the page unless they read the button label closely.What Was Checked
frontend-dapp/src/pages/SwapPage.tsxlines 934-935:isRateLimitExceededgates button disable and label.frontend-dapp/src/utils/marketDataServiceCopy.tsline 32:WRAP_RATE_LIMIT_EXCEEDED_MESSAGEcopy exists but is used only as the button label.frontend-dapp/src/pages/SwapPage.tsxline 1679:isPairPausedrenders a visible alert block below the form. No equivalent alert block forisRateLimitExceeded.frontend-dapp/src/utils/humanizeOffChainError.tsline 81: indexer 429 maps to calm copy shown as a banner; the wrap rate limit does not trigger this path.Expected (per checklist)
When
isRateLimitExceededis true, an inline alert block (matching the style of theisPairPausedalert) is displayed below the swap form explaining the rate limit and providing retry guidance. Users should not need to read the disabled button label to understand why they cannot submit.Actual
No inline alert renders when the wrap mapper rate limit is exceeded. The only visible indication is the disabled button label "Daily wrap limit exceeded."
Suggested Fix
In
SwapPage.tsx, add an alert block conditional onisRateLimitExceeded(similar to theisPairPausedalert at line 1679) with copy such as: "Daily wrap limit reached for this amount. Try again later or reduce the amount." The block should be visible without the user focusing on the button.Verification Checklist
isRateLimitExceededtriggers an inline alert block below the swap form in addition to the disabled button labelisRateLimitExceededis trueCc: @PlasticDigits
mentioned in issue #454
mentioned in issue #381
mentioned in merge request !988
Done. When the wrap-mapper rate limit is hit, the swap form only disabled the button with a "Rate Limit Exceeded" label — no visible explanation, unlike the pair-paused and blacklist states which render an alert below the form.
Added an
alert-errorblock gated onisRateLimitExceeded(same pattern as the isPairPaused alert), with actionable copy: "Daily wrap limit reached for this amount. Wait and try again later, or reduce the amount." (WRAP_RATE_LIMIT_EXCEEDED_MESSAGEin marketDataServiceCopy.ts).Note: the issue referenced
WRAP_RATE_LIMIT_EXCEEDED_MESSAGEat marketDataServiceCopy.ts:32, but that line was actuallyINDEXER_RATE_LIMIT_RETRY_MESSAGEand the wrap label was hardcoded — so I added the dedicated constant.Tests: extended the wrap rate-limit suite to assert
swap-wrap-rate-limit-bannerrenders with the retry guidance; SwapPage suites green, tsc clean. Source + unit verified here; the e2e assertion in wrap-swap.spec.ts is a laptop item.MR !988, branch
qa/463-wrap-rate-limit-alert, commit152f7064. Needs review/merge @PlasticDigits — leaving open for verification.mentioned in commit
d163b55507mentioned in commit
cca89a6ad4mentioned in merge request !998
mentioned in commit
4621116ed2Verification complete — all acceptance criteria PASS
Verified on
main(commits152f7064,cca89a6a, merged via !988).Checklist
isRateLimitExceededrenders inlinealert-errorbelow swap form (not only disabled CTA)SwapPage.tsxgatesdata-testid="swap-wrap-rate-limit-banner"onisRateLimitExceeded(samealert-error mb-3 text-xspattern as pair-paused/blacklist alerts)WRAP_RATE_LIMIT_EXCEEDED_MESSAGE: "Daily wrap limit reached for this amount. Wait and try again later, or reduce the amount."SwapPage.test.tsx—shows an inline rate-limit alert with retry guidance, not just the disabled buttonwrap-swap.spec.tsE12 —swap-wrap-rate-limit-bannervisible with retry copyCommands run
Notes
skills/AGENTS_FRONTEND_SWAP_SAFETY_CTA.md,docs/testing.md).Closing as verified — no further code changes required.
mentioned in issue #502
mentioned in issue #503
mentioned in issue #507