Investigate in-flight TX link during Confirming phase + Playwright spec (GitLab #305 follow-up) #330
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#330
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?
Parent
Follow-up to GitLab #305 (Terra broadcast confirming phase — open, MR !778 merged). Verification (2026-06-05) passed Confirming… button label but FAILED in-flight TX: explorer link visibility.
Current codebase
broadcastTerraExecuteContracts(frontend-dapp/src/services/terraclassic/terraBroadcast.ts) emitssigning→broadcasting→confirmingwith optionaltxHashin phase context.useTerraBroadcastMutation(frontend-dapp/src/hooks/useTerraBroadcastMutation.ts) setspendingTxHashfromctx.txHashon phase changes (clears onsigning, clears ononSettled).TerraBroadcastPendingLink(frontend-dapp/src/components/ui/TerraBroadcastPendingLink.tsx) rendersTX: <hash>only whenphase === 'confirming' && txHash. Wired on Swap, Pool, Limits, Trade market, ladder panels.terraBroadcastPendingButtonLabelreturnsConfirming…for confirming phase.pollTxmay resolve before React paints the confirming frame — manual QA saw hash only in post-successTxResultAlert.Why this is needed
Users cannot click through to the explorer while the chain confirms — the primary #305 UX goal for mid-flight visibility. Either:
pendingTxHashis never set before poll completes on fast chains, orA Playwright spec with optional slow-poll mock makes the behavior regression-testable regardless of chain speed.
Constraints / guardrails
TerraBroadcastPendingLinkmust not flash duringsigning/broadcasting(onlyconfirming).onSettledcleanup — hash clears after success/failure.pollTxdelay only in test env if needed.Relevant files
frontend-dapp/src/hooks/useTerraBroadcastMutation.tsfrontend-dapp/src/components/ui/TerraBroadcastPendingLink.tsxfrontend-dapp/src/utils/terraBroadcastUi.tsfrontend-dapp/src/services/terraclassic/terraBroadcast.tsfrontend-dapp/src/services/terraclassic/terraBroadcastScope.tsfrontend-dapp/src/pages/SwapPage.tsxuseTerraBroadcastMutation.test.tsx,terraBroadcast.test.ts,terraBroadcastUi.test.tsfrontend-dapp/e2e/— terra broadcast tx link specRecommended direction
pendingTxHashis set whenonPhaseChange('confirming', { txHash })fires beforepollTxresolves. If race: callonPhaseChangesynchronously after broadcast returns hash before awaiting poll (verify current order interraBroadcast.ts).flushSyncis a last resort — prefer ensuring phase+hash state update is committed before poll await starts.Confirming…TX:link visible with shortened hash (data-testidon link recommended)data-testid="terra-broadcast-pending-tx"onTerraBroadcastPendingLinkfor stable selectors.Acceptance criteria
confirmingphase,TX:link visible with correct hash on Swap (minimum); ideally allTerraBroadcastPendingLinkcall sites.signing/broadcastingand after settle.Confirming…+TX:visibility (with slow-poll mock if required for CI stability).terraBroadcastphase-order unit tests still pass.Test plan — all paths
Confirming…+TX:linkTxResultAlertshows hashconfirming; noTX:linksigningonly; no hashTest plan — attack / abuse / hack vectors
shortenTxHashForDisplay;rel="noopener noreferrer"on external linkbroadcastTerraExecuteContractssets hash through scoped callbackonSettledclearspendingTxHashVerification criteria
make test-frontendgreen including new Playwright spec (or component test if E2E skipped in CI).pollTxdelay (dev-only),TX:visible during confirming.marked as related to #305
mentioned in commit
ea15444973mentioned in merge request !810
Implementation complete
MR: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/92
Root cause: React 18 batches
setStateinside asyncmutationFn, sopendingTxHashwas cleared inonSettledbefore the confirming-phase TX: link could paint on fast LocalTerra.Fix:
flushSyncinuseTerraBroadcastMutationwhen applying phase/hash updates so confirming state commits beforepollTx.Acceptance
flushSync+TerraBroadcastPendingLinkunchanged guardTerraBroadcastPendingLink.test.tsxterra-broadcast-confirming-link-tx.spec.ts— runmake test-e2e-txmake test-frontend(854 tests)data-testid="terra-broadcast-pending-tx"added for stable E2E selectors.mentioned in commit
c1e523960cAGENT should not skip "Playwright confirming" + TX, and should test in keplr
mentioned in merge request !827
Verification complete — GitLab #330
Issue: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/330
Implementation: MR !810 (merged to
main@700b3ed)Verified on branch:
main(700b3ed)Acceptance criteria
confirming, TX: link visible with correct hash on SwapTerraBroadcastPendingLink.test.tsx; Playwrightterra-broadcast-confirming-link-tx.spec.ts(4s LCD poll delay); manual swap capturedTX: 4432B2…/TX: 4FA04…during confirmingsigning/broadcastingand after settleTerraBroadcastPendingLink.test.tsx(signing/broadcasting null); E2E assertspendingTxhidden afterTxResultAlertConfirming…+TX:visibilitysg docker -c 'cd frontend-dapp && npx playwright test --project=e2e-tx e2e/terra-broadcast-confirming-link-tx.spec.ts'→ 1 passed (37.9s)terraBroadcastphase-order unit testsmake test-frontend→ 143 files, 871 tests passedVerification criteria
make test-frontendgreenmake test-frontend— 871 passedhttp://127.0.0.1:5173/swap— confirming frame <1s but TX: link observed; E2E uses route delay for stable assertionretain-on-failure); test passed without failureTest plan spot-checks
Confirming…+TX:)TxResultAlerthash)assertTxResultAlert+ hidden pending link)data-testid="terra-broadcast-pending-tx"flushSyncinuseTerraBroadcastMutationNotes
useTerraBroadcastMutation).Closing #330 — all acceptance criteria met on
main. Recommend closing parent #305 as well.mentioned in commit
0a7fe6208fmentioned in commit
096d7915f4mentioned in commit
f0d3841345mentioned in issue #337