Skip to content

feat: implement client broadcast recovery queue (#18) - #28

Merged
JamesEjembi merged 1 commit into
Lumina-etwork:mainfrom
Husten150:fix/tx-recovery-queue
Jun 17, 2026
Merged

feat: implement client broadcast recovery queue (#18)#28
JamesEjembi merged 1 commit into
Lumina-etwork:mainfrom
Husten150:fix/tx-recovery-queue

Conversation

@Husten150

Copy link
Copy Markdown
Contributor

Summary

Implements a resilient client-side transaction recovery queue that tracks every Soroban broadcast attempt in localStorage using a write-ahead log pattern, monitors transaction status on reconnect, and provides a dedicated reconciliation UI.

Changes

New Files

File Purpose
src/lib/sorobanClient.ts Soroban JSON-RPC client wrapping getTransaction and sendTransaction
src/services/txPersistence.ts localStorage CRUD with schema versioning, write-ahead log pattern
src/hooks/useTxRetryQueue.ts Queue hook — auto-syncs pending txs on mount, exposes retry/cancel/clear
src/components/wallet/PendingTxPanel.tsx UI panel with status badges, Retry/Remove/Clear controls
app/pending-tx/page.tsx Dedicated /pending-tx route for the recovery queue
src/services/__tests__/txPersistence.test.ts 8 unit tests including tab crash recovery simulation

Modified Files

File Change
src/hooks/useSorobanBilling.ts Added submitWithQueue — writes TxRecord before broadcast, updates after
app/page.tsx Added "Pending" nav link to dashboard header
tsconfig.json Excluded test files from type-checking

Architecture (Write-Ahead Log)

  1. Before broadcastenqueue() writes a TxRecord (status: pending) to localStorage
  2. BroadcastsendTransaction() submits via Soroban RPC
  3. After broadcastupdateRecord() saves tx hash and status
  4. On page loadsyncWithNetwork() checks all pending/unknown records via getTransaction()
  5. UIPendingTxPanel at /pending-tx shows the queue with Retry/Remove/Clear Completed controls

Closes #18

…k reboots

- Add Soroban JSON-RPC client (getTransaction, sendTransaction) in src/lib/sorobanClient.ts
- Create txPersistence.ts with localStorage CRUD, schema versioning, and write-ahead log pattern
- Build useTxRetryQueue hook that auto-syncs pending transactions on mount
- Integrate queue into useSorobanBilling with write-ahead logging before broadcast
- Add PendingTxPanel component with status badges (pending/confirmed/failed/unknown)
- Create /pending-tx route and add nav link to dashboard
- Write 8 unit tests including tab crash recovery simulation
- Exclude test files from tsconfig

Closes Lumina-etwork#18
@JamesEjembi
JamesEjembi merged commit f8bb48c into Lumina-etwork:main Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client Broadcast Recovery Queues Tracking Mid-Submit Network Reboots

2 participants