Background & current state
On register/claim the UI waits on chain confirmation with little immediate feedback (TransactionStatus.jsx shows status, but state isn't optimistic). This feels slow.
Goal
Add optimistic UI for register/claim: reflect the expected state immediately on submit, then confirm or roll back on result.
Technical design
- On submit, optimistically update local state (e.g., "registered", balance change); on confirmation, reconcile with chain truth; on failure, roll back + show a mapped error (
errorMapping.js).
- Guard against double-submit; show pending indicators.
Edge cases
- Tx fails after optimistic update → clean rollback to correct state.
- Slow confirmation → keep pending UI, allow cancel where possible.
- Concurrent actions → consistent reconciliation.
- Network/RPC error vs contract revert → distinct messaging.
Task breakdown
Acceptance criteria
Testing & verification
- E2E forcing tx failure → rollback; success path reconciliation.
Out of scope
Dependencies / related
- Uses
errorMapping.js/TransactionStatus.jsx; pairs with NEW-108.
Difficulty: medium · Effort: M
Background & current state
On register/claim the UI waits on chain confirmation with little immediate feedback (
TransactionStatus.jsxshows status, but state isn't optimistic). This feels slow.Goal
Add optimistic UI for register/claim: reflect the expected state immediately on submit, then confirm or roll back on result.
Technical design
errorMapping.js).Edge cases
Task breakdown
Acceptance criteria
Testing & verification
Out of scope
Dependencies / related
errorMapping.js/TransactionStatus.jsx; pairs with NEW-108.Difficulty: medium · Effort: M