EH-1 UI: Insufficient gas error exposes developer-facing copy, internal GitLab issue number, and CLI instructions to end users #371

Closed
opened 2026-06-12 11:00:05 +00:00 by totdking · 15 comments
totdking commented 2026-06-12 11:00:05 +00:00 (Migrated from gitlab.com)
No description provided.
totdking commented 2026-06-12 11:01:13 +00:00 (Migrated from gitlab.com)

Summary

When a transaction is submitted with an insufficient gas limit (e.g. Keplr returning a very low gas value), the dapp surfaces a verbose error message that contains:

  • An internal GitLab issue reference (GitLab #127)
  • Shell CLI instructions (cd frontend-dapp && npm ci)
  • Raw uluna micro-unit values (Expected at least ~50985000 uluna; wallet returned ~29 uluna)
  • A Station-wallet-specific troubleshooting step that is incorrect for Keplr users
  • Raw gas unit values (Expected gas at least ~1800000; wallet returned ~1)

Observed error message (verbatim):

Wallet signed a fee far below what this dApp submitted (GitLab #127). On LocalTerra with Station: disconnect, reconnect, and approve any chain-update prompt. Run cd frontend-dapp && npm ci so the cosmes patch is applied, then retry. Expected at least ~50985000 uluna; wallet returned ~29 uluna. Expected gas at least ~1800000; wallet returned ~1.


Reproduction steps

  1. Navigate to / (Swap page) on LocalTerra
  2. Connect Keplr wallet
  3. Open Keplr advanced settings and set a very low gas limit before approving
  4. Submit any swap transaction and approve with the reduced gas
  5. Observe: the verbose error message above is displayed in the UI

Expected behavior

The error message shown to the user should be short, plain-language, and actionable without internal context. Example appropriate message:

"Transaction fee mismatch. Please reconnect your wallet and try again. If the problem persists, contact support."

Raw uluna values, GitLab issue numbers, shell commands, and wallet-specific troubleshooting steps should never appear in the user-facing error string.


Actual behavior

The full developer diagnostic string is rendered verbatim in the UI, including:

  • GitLab #127 (internal issue tracker reference)
  • cd frontend-dapp && npm ci (shell CLI instruction)
  • 50985000 uluna / ~1800000 gas (raw micro-unit values)
  • Station wallet instructions (wrong wallet for Keplr users)

Environment

  • Chain: localterra
  • LCD: http://localhost:1317
  • Wallet: Keplr (Terra Classic)
  • Browser: Chrome
  • Page: / (Swap)
  • Network throttle applied: No

Severity: P3 -- the gas mismatch is correctly caught and the transaction is blocked. The failure is in the error copy: developer-facing diagnostic text is shown to the user instead of a clean, user-appropriate message.

Related checklist items: EH-1

cc: @PlasticDigits

### Summary When a transaction is submitted with an insufficient gas limit (e.g. Keplr returning a very low gas value), the dapp surfaces a verbose error message that contains: - An internal GitLab issue reference (`GitLab #127`) - Shell CLI instructions (`cd frontend-dapp && npm ci`) - Raw `uluna` micro-unit values (`Expected at least ~50985000 uluna; wallet returned ~29 uluna`) - A Station-wallet-specific troubleshooting step that is incorrect for Keplr users - Raw gas unit values (`Expected gas at least ~1800000; wallet returned ~1`) **Observed error message (verbatim):** > Wallet signed a fee far below what this dApp submitted (GitLab #127). On LocalTerra with Station: disconnect, reconnect, and approve any chain-update prompt. Run `cd frontend-dapp && npm ci` so the cosmes patch is applied, then retry. Expected at least \~50985000 uluna; wallet returned \~29 uluna. Expected gas at least \~1800000; wallet returned \~1. --- ### Reproduction steps 1. Navigate to `/` (Swap page) on LocalTerra 2. Connect Keplr wallet 3. Open Keplr advanced settings and set a very low gas limit before approving 4. Submit any swap transaction and approve with the reduced gas 5. Observe: the verbose error message above is displayed in the UI --- ### Expected behavior The error message shown to the user should be short, plain-language, and actionable without internal context. Example appropriate message: > "Transaction fee mismatch. Please reconnect your wallet and try again. If the problem persists, contact support." Raw uluna values, GitLab issue numbers, shell commands, and wallet-specific troubleshooting steps should never appear in the user-facing error string. --- ### Actual behavior The full developer diagnostic string is rendered verbatim in the UI, including: - `GitLab #127` (internal issue tracker reference) - `cd frontend-dapp && npm ci` (shell CLI instruction) - `50985000 uluna` / `~1800000` gas (raw micro-unit values) - Station wallet instructions (wrong wallet for Keplr users) --- ### Environment - Chain: localterra - LCD: [http://localhost:1317](http://localhost:1317) - Wallet: Keplr (Terra Classic) - Browser: Chrome - Page: `/` (Swap) - Network throttle applied: No --- **Severity:** P3 -- the gas mismatch is correctly caught and the transaction is blocked. The failure is in the error copy: developer-facing diagnostic text is shown to the user instead of a clean, user-appropriate message. **Related checklist items:** EH-1 cc: @PlasticDigits
totdking commented 2026-06-12 11:02:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #291

mentioned in issue #291
PlasticDigits commented 2026-06-12 11:09:23 +00:00 (Migrated from gitlab.com)

mentioned in commit b63edb011c

mentioned in commit b63edb011c77d3727672826b8b7ce8aaa2fb8f1b
PlasticDigits commented 2026-06-12 11:09:34 +00:00 (Migrated from gitlab.com)

mentioned in merge request !884

mentioned in merge request !884
PlasticDigits commented 2026-06-12 11:17:37 +00:00 (Migrated from gitlab.com)

mentioned in commit b066bdb330

mentioned in commit b066bdb3307d7fdd10a7052752d6bda447d30c2a
PlasticDigits commented 2026-06-12 11:39:40 +00:00 (Migrated from gitlab.com)

mentioned in commit 809d2b9842

mentioned in commit 809d2b984246290b600cae2a9805425aae413434
PlasticDigits commented 2026-06-12 12:00:33 +00:00 (Migrated from gitlab.com)

mentioned in merge request !888

mentioned in merge request !888
PlasticDigits commented 2026-06-13 02:40:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 87b6f9a3da

mentioned in commit 87b6f9a3da64467062650551294f42987343a756
PlasticDigits commented 2026-06-13 03:07:26 +00:00 (Migrated from gitlab.com)

mentioned in merge request !895

mentioned in merge request !895
PlasticDigits commented 2026-06-13 03:38:24 +00:00 (Migrated from gitlab.com)

mentioned in commit b8238b0237

mentioned in commit b8238b02375d2622c626a513b9e6b888e7997c97
PlasticDigits commented 2026-06-13 03:41:13 +00:00 (Migrated from gitlab.com)

mentioned in commit fe5c3c2fb5

mentioned in commit fe5c3c2fb5160938bd33e44b549976cac2e0e751
PlasticDigits commented 2026-06-13 03:55:07 +00:00 (Migrated from gitlab.com)

mentioned in merge request !897

mentioned in merge request !897
PlasticDigits commented 2026-06-13 04:30:23 +00:00 (Migrated from gitlab.com)

mentioned in commit 78e3222be9

mentioned in commit 78e3222be91ebb7e53521431b403df137f66705a
PlasticDigits commented 2026-06-13 04:38:05 +00:00 (Migrated from gitlab.com)

mentioned in issue #372

mentioned in issue #372
PlasticDigits commented 2026-06-13 07:47:57 +00:00 (Migrated from gitlab.com)

Verify #371 — PASS

Verified on main @ 78e3222b (MR !897 merged). No additional repo changes required.

Acceptance criteria

Item Result How verified
UI must not show GitLab #127, npm ci, raw uluna/gas values, or Station-only steps PASS Unit tests assert retail copy only; cosmes KeplrExtension.js throws EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE; browser bundle humanize returns retail string
Expected retail message: "Transaction fee mismatch. Please reconnect your wallet and try again. If the problem persists, contact support." PASS Matches EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE / EXTENSION_SIGNED_FEE_USER_MESSAGE
Diagnostics stay in logs, not UI PASS extensionSignedFeeGuard logs via console.warn; UI returns retail copy
Issue repro: Keplr + very low gas on Swap / SKIP Keplr extension gas override in the signing popup is not automatable in this headless Cloud Agent VM; equivalent behavior verified at guard, broadcast (handleBroadcastError → tryHumanizeTerraTxMessage), TxResultAlert, and patched cosmes Keplr path

Commands run

# Issue context
glab issue view 371 --comments

# Targeted unit tests (62 passed)
bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- --run \
  src/utils/__tests__/humanizeUserFacingError.test.ts \
  src/utils/__tests__/humanizeTerraTxError.test.ts \
  src/utils/__tests__/extensionSignedFeeGuard.test.ts \
  src/components/ui/__tests__/TxResultAlert.test.tsx \
  src/services/terraclassic/__tests__/terraBroadcast.test.ts

# Cosmes patch regression (3 passed)
bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- --run \
  src/services/terraclassic/__tests__/cosmesPatch127.test.ts

# LocalTerra + frontend (make setup-cloud-localterra --fresh --skip-build; make dev)
make has-localterra

# Browser bundle humanize (Playwright against http://127.0.0.1:5173)
# → PASS: humanizeUserFacingError(diagnostic) === retail copy

Implementation layers confirmed

  1. extensionSignedFeeGuard.ts — returns retail EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE; diagnostics only in console.warn
  2. humanizeTerraTxError.ts — maps legacy EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX throws to retail copy (defense in depth)
  3. terraBroadcast.ts handleBroadcastError — humanizes before rethrow
  4. TxResultAlert — applies humanizeUserFacingError on error display
  5. cosmes patch KeplrExtension.js — return new Error(EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE) at post-sign guard

Docs/skills cross-links present in docs/frontend.md, skills/AGENTS_FRONTEND_USER_ERRORS.md, skills/AGENTS_TERRACLASSIC_GAS.md.

## Verify #371 — PASS Verified on `main` @ `78e3222b` (MR !897 merged). No additional repo changes required. ### Acceptance criteria | Item | Result | How verified | |------|--------|--------------| | UI must not show `GitLab #127`, `npm ci`, raw `uluna`/gas values, or Station-only steps | **PASS** | Unit tests assert retail copy only; cosmes `KeplrExtension.js` throws `EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE`; browser bundle humanize returns retail string | | Expected retail message: *"Transaction fee mismatch. Please reconnect your wallet and try again. If the problem persists, contact support."* | **PASS** | Matches `EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE` / `EXTENSION_SIGNED_FEE_USER_MESSAGE` | | Diagnostics stay in logs, not UI | **PASS** | `extensionSignedFeeGuard` logs via `console.warn`; UI returns retail copy | | Issue repro: Keplr + very low gas on Swap `/` | **SKIP** | Keplr extension gas override in the signing popup is not automatable in this headless Cloud Agent VM; equivalent behavior verified at guard, broadcast (`handleBroadcastError` → `tryHumanizeTerraTxMessage`), `TxResultAlert`, and patched cosmes Keplr path | ### Commands run ```bash # Issue context glab issue view 371 --comments # Targeted unit tests (62 passed) bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- --run \ src/utils/__tests__/humanizeUserFacingError.test.ts \ src/utils/__tests__/humanizeTerraTxError.test.ts \ src/utils/__tests__/extensionSignedFeeGuard.test.ts \ src/components/ui/__tests__/TxResultAlert.test.tsx \ src/services/terraclassic/__tests__/terraBroadcast.test.ts # Cosmes patch regression (3 passed) bash scripts/with-node.sh --cwd frontend-dapp -- npm test -- --run \ src/services/terraclassic/__tests__/cosmesPatch127.test.ts # LocalTerra + frontend (make setup-cloud-localterra --fresh --skip-build; make dev) make has-localterra # Browser bundle humanize (Playwright against http://127.0.0.1:5173) # → PASS: humanizeUserFacingError(diagnostic) === retail copy ``` ### Implementation layers confirmed 1. **`extensionSignedFeeGuard.ts`** — returns retail `EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE`; diagnostics only in `console.warn` 2. **`humanizeTerraTxError.ts`** — maps legacy `EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX` throws to retail copy (defense in depth) 3. **`terraBroadcast.ts` `handleBroadcastError`** — humanizes before rethrow 4. **`TxResultAlert`** — applies `humanizeUserFacingError` on error display 5. **cosmes patch `KeplrExtension.js`** — `return new Error(EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGE)` at post-sign guard Docs/skills cross-links present in `docs/frontend.md`, `skills/AGENTS_FRONTEND_USER_ERRORS.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-13 07:47:59 +00:00
Sign in to join this conversation.
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#371
No description provided.