fix(frontend): recover from account sequence mismatch on mint (#499) #1039

Merged
PlasticDigits merged 1 commit from fix/499-mint-sequence-mismatch into main 2026-07-25 04:53:41 +00:00
PlasticDigits commented 2026-07-25 04:34:10 +00:00 (Migrated from gitlab.com)

Summary

  • Refresh Cosmes wallet account sequence at sign time (getAuthInfo(false)) so Mint/other txs do not reuse a stale cached sequence when the same account is active elsewhere.
  • On Cosmos CheckTx code-32 (account sequence mismatch), re-sign and re-broadcast once using the chain-expected sequence via shared broadcastTerraExecuteContracts (not Mint-page-only logic; not #359 recovery).
  • After a failed retry, surface short retail copy Wallet out of sync. Try again. (anti cognitive overload / #489); raw chain text stays in console.error.

Issue criteria

  • Fetch account sequence at signing time
  • Auto-retry once on code-32 sequence mismatch
  • Friendly short message after retry still fails (minimized per issue note / #489)
  • UI expandable/raw-error disclosure on Mint — not done; diagnostics remain in console (consistent with existing error funnel)

Test plan

  • terraAccountSequence unit tests
  • terraBroadcastRecovery code-32 retry success + no #359 recovery
  • humanizeTerraTxError sequence mismatch mapping
  • Related broadcast/transactions/MintPage suites (108 tests) + retest of core suites
  • Manual: Mint TOPAZ on mainnet/soft-launch with a concurrently active signer; first mismatch should auto-retry; persistent mismatch shows short copy

Docs / invariants

  • docs/frontend.md broadcast invariants (#499)
  • Soft-launch F14 in docs/runbooks/soft-launch-faucet.md
  • Skills: AGENTS_FRONTEND_TX_BROADCAST_TIMEOUT.md, AGENTS_SOFT_LAUNCH_FAUCET.md, AGENTS_FRONTEND_USER_ERRORS.md

Closes #499

## Summary - Refresh Cosmes wallet account sequence at sign time (`getAuthInfo(false)`) so Mint/other txs do not reuse a stale cached sequence when the same account is active elsewhere. - On Cosmos CheckTx code-32 (`account sequence mismatch`), re-sign and re-broadcast **once** using the chain-expected sequence via shared `broadcastTerraExecuteContracts` (not Mint-page-only logic; not #359 recovery). - After a failed retry, surface short retail copy **`Wallet out of sync. Try again.`** (anti cognitive overload / #489); raw chain text stays in `console.error`. ## Issue criteria - [x] Fetch account sequence at signing time - [x] Auto-retry once on code-32 sequence mismatch - [x] Friendly short message after retry still fails (minimized per issue note / #489) - [ ] UI expandable/raw-error disclosure on Mint — **not done**; diagnostics remain in console (consistent with existing error funnel) ## Test plan - [x] `terraAccountSequence` unit tests - [x] `terraBroadcastRecovery` code-32 retry success + no #359 recovery - [x] `humanizeTerraTxError` sequence mismatch mapping - [x] Related broadcast/transactions/MintPage suites (108 tests) + retest of core suites - [ ] Manual: Mint TOPAZ on mainnet/soft-launch with a concurrently active signer; first mismatch should auto-retry; persistent mismatch shows short copy ## Docs / invariants - `docs/frontend.md` broadcast invariants (#499) - Soft-launch **F14** in `docs/runbooks/soft-launch-faucet.md` - Skills: `AGENTS_FRONTEND_TX_BROADCAST_TIMEOUT.md`, `AGENTS_SOFT_LAUNCH_FAUCET.md`, `AGENTS_FRONTEND_USER_ERRORS.md` Closes #499
ghost1 commented 2026-07-25 04:34:12 +00:00 (Migrated from gitlab.com)

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot) to get automatic reviews on future PRs.
PlasticDigits commented 2026-07-25 04:53:41 +00:00 (Migrated from gitlab.com)

mentioned in commit b734964e7b

mentioned in commit b734964e7bd8e175fc02ad8e7d68d3b7cc749a32
PlasticDigits (Migrated from gitlab.com) merged commit b734964e7b into main 2026-07-25 04:53:41 +00:00
leonardocolucci commented 2026-08-17 21:14:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #499

mentioned in issue #499
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!1039
No description provided.