fix(frontend): in-flight TX link during Confirming phase (#330) #810
No reviewers
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!810
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-e2b9"
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
Closes the GitLab #305 follow-up in #330.
On fast LocalTerra,
pollTxoften finished before React painted the confirming-phase TX: explorer link. Root cause:useTerraBroadcastMutationupdates phase/hash from an asyncmutationFn, so React 18 batchessetStateuntil afterpollTxresolves andonSettledclears state.Fix: wrap phase/hash updates in
flushSyncso confirming +pendingTxHashcommit beforepollTxawaits.Also adds
data-testid="terra-broadcast-pending-tx", unit tests, and a Playwright tx spec that delays LCD/cosmos/tx/v1beta1/txs/*polling for stable CI observation.Acceptance checklist
confirming, TX: link visible on Swap with correct hashTerraBroadcastPendingLink+flushSyncin hook; unit + E2E specsigning/broadcastingand after settleTerraBroadcastPendingLink.test.tsxConfirming…+TX:(slow-poll mock)e2e/terra-broadcast-confirming-link-tx.spec.tsmake test-e2e-tx)terraBroadcastphase-order unit testsmake test-frontend(includesterraBroadcast.test.ts)Commands run
Third-party verification
make setup-cloud-localterra(or existing LocalTerra deploy)make dev→ swap with Simulated Wallet; during confirming, TX: link appears under the buttonmake test-e2e-tx(ornpm run test:e2e:txwith deploy env) — includesterra-broadcast-confirming-link-tx.spec.tsRelated
changed the description
mentioned in issue #330
changed the description
changed the description
Security review
Commit reviewed:
ea154449735b3177b81d993239c49beb22f56114Scope: 5 files —
useTerraBroadcastMutation.ts(flushSyncon phase/hash state),TerraBroadcastPendingLink.tsx(data-testid), unit tests, Playwright E2E spec.Outcome:
FINDINGS: 0medium+Summary: This MR is a React 18 batching/timing fix so the confirming-phase TX explorer link paints before
pollTxsettles. No new auth boundaries, network endpoints, secrets, or dependency changes.pendingTxHashstill originates fromwallet.broadcastTx()viabroadcastTerraExecuteContracts(unchanged trust model). Explorer URLs are still built bygetExplorerTxUrl()with a fixed base prefix; link text uses React JSX escaping and existingrel="noopener noreferrer".flushSyncis invoked only on discrete phase transitions (signing → broadcasting → confirming), not in a hot loop — no plausible DoS path introduced.Inline threads: none (no medium+ findings on this diff).
mentioned in commit
c1e523960cmentioned in commit
0a7fe6208fmentioned in commit
f0d3841345