frontend: inline alert when wrap-mapper rate limit blocks a swap (#463) #988

Merged
Brouie merged 1 commit from qa/463-wrap-rate-limit-alert into main 2026-06-30 22:06:33 +00:00
Brouie commented 2026-06-30 19:26:51 +00:00 (Migrated from gitlab.com)

When the wrap-mapper daily rate limit is hit, SwapPage only disabled the submit
button with a "Rate Limit Exceeded" label — no inline explanation, unlike the
pair-paused / blacklist states which render a visible alert below the form
(SEC-I05 F-04).

Add an alert-error block gated on isRateLimitExceeded (matching the
isPairPaused pattern) with actionable retry copy
(WRAP_RATE_LIMIT_EXCEEDED_MESSAGE), so users see why they can't submit without
reading the button label.

Tests: extended the wrap rate-limit suite to assert the swap-wrap-rate-limit- banner renders with the retry guidance; SwapPage suites green, tsc clean.

Source + unit verified; the e2e (wrap-swap.spec.ts) assertion is a laptop item.

When the wrap-mapper daily rate limit is hit, SwapPage only disabled the submit button with a "Rate Limit Exceeded" label — no inline explanation, unlike the pair-paused / blacklist states which render a visible alert below the form (SEC-I05 F-04). Add an `alert-error` block gated on `isRateLimitExceeded` (matching the isPairPaused pattern) with actionable retry copy (`WRAP_RATE_LIMIT_EXCEEDED_MESSAGE`), so users see why they can't submit without reading the button label. Tests: extended the wrap rate-limit suite to assert the `swap-wrap-rate-limit- banner` renders with the retry guidance; SwapPage suites green, tsc clean. Source + unit verified; the e2e (wrap-swap.spec.ts) assertion is a laptop item.
Brouie commented 2026-06-30 19:26:52 +00:00 (Migrated from gitlab.com)

assigned to @Brouie

assigned to @Brouie
PlasticDigits commented 2026-06-30 19:28:50 +00:00 (Migrated from gitlab.com)

Security review — MR !988

Commit reviewed: 152f70641071b0df8dbdf5d4788b9f0a59442237
Scope: Added/modified diff only — SwapPage.tsx inline wrap rate-limit alert, WRAP_RATE_LIMIT_EXCEEDED_MESSAGE constant, and unit test.

Outcome: FINDINGS: 0 (no medium, high, or critical issues on this diff)

Summary

This MR adds UX-only feedback when the existing client-side wrap-mapper rate-limit precheck (isRateLimitExceeded from checkRateLimitExceeded) is true. It mirrors the existing pair-paused / trading-blacklist alert-error pattern.

Reviewed attack paths

Area Result
XSS Alert body is a hardcoded string (WRAP_RATE_LIMIT_EXCEEDED_MESSAGE) rendered as JSX text in <p>. No dangerouslySetInnerHTML, no interpolation of user/chain/indexer strings. React text escaping applies.
Injection No new sinks; no new query parameters or API calls introduced.
Authn/authz Display-only change; submit button disable logic was already gated on isRateLimitExceeded. On-chain wrap-mapper rate limits remain the enforcement boundary.
Info disclosure Shows generic retry copy to the connected user who would be blocked — intentional UX (#463 / SEC-I05 F-04), not sensitive data leakage.
Client-side bypass Pre-existing: UI precheck can be bypassed by direct contract calls; enforcement is on-chain. Not introduced or worsened by this MR.
Dependencies / supply chain No dependency changes.

Prior threads

No prior security-review comments on this MR; nothing to re-report.

Inline threads: none (no medium+ findings).

## Security review — MR !988 **Commit reviewed:** `152f70641071b0df8dbdf5d4788b9f0a59442237` **Scope:** Added/modified diff only — `SwapPage.tsx` inline wrap rate-limit alert, `WRAP_RATE_LIMIT_EXCEEDED_MESSAGE` constant, and unit test. **Outcome:** `FINDINGS: 0` (no medium, high, or critical issues on this diff) ### Summary This MR adds UX-only feedback when the existing client-side wrap-mapper rate-limit precheck (`isRateLimitExceeded` from `checkRateLimitExceeded`) is true. It mirrors the existing pair-paused / trading-blacklist `alert-error` pattern. ### Reviewed attack paths | Area | Result | |------|--------| | **XSS** | Alert body is a hardcoded string (`WRAP_RATE_LIMIT_EXCEEDED_MESSAGE`) rendered as JSX text in `<p>`. No `dangerouslySetInnerHTML`, no interpolation of user/chain/indexer strings. React text escaping applies. | | **Injection** | No new sinks; no new query parameters or API calls introduced. | | **Authn/authz** | Display-only change; submit button disable logic was already gated on `isRateLimitExceeded`. On-chain wrap-mapper rate limits remain the enforcement boundary. | | **Info disclosure** | Shows generic retry copy to the connected user who would be blocked — intentional UX (#463 / SEC-I05 F-04), not sensitive data leakage. | | **Client-side bypass** | Pre-existing: UI precheck can be bypassed by direct contract calls; enforcement is on-chain. Not introduced or worsened by this MR. | | **Dependencies / supply chain** | No dependency changes. | ### Prior threads No prior security-review comments on this MR; nothing to re-report. **Inline threads:** none (no medium+ findings).
Brouie commented 2026-06-30 19:29:03 +00:00 (Migrated from gitlab.com)

mentioned in issue #463

mentioned in issue #463
PlasticDigits commented 2026-06-30 22:06:33 +00:00 (Migrated from gitlab.com)

mentioned in commit d163b55507

mentioned in commit d163b55507a7ac01c7389958d44f83af8e65af55
PlasticDigits (Migrated from gitlab.com) merged commit d163b55507 into main 2026-06-30 22:06:33 +00:00
PlasticDigits commented 2026-06-30 22:37:10 +00:00 (Migrated from gitlab.com)

mentioned in commit cca89a6ad4

mentioned in commit cca89a6ad4ece4017086d84c67d0043344170c4a
PlasticDigits commented 2026-06-30 22:38:26 +00:00 (Migrated from gitlab.com)

mentioned in merge request !998

mentioned in merge request !998
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!988
No description provided.