feat: implement client broadcast recovery queue (#18) - #28
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
src/lib/sorobanClient.tsgetTransactionandsendTransactionsrc/services/txPersistence.tssrc/hooks/useTxRetryQueue.tssrc/components/wallet/PendingTxPanel.tsxapp/pending-tx/page.tsx/pending-txroute for the recovery queuesrc/services/__tests__/txPersistence.test.tsModified Files
src/hooks/useSorobanBilling.tssubmitWithQueue— writes TxRecord before broadcast, updates afterapp/page.tsxtsconfig.jsonArchitecture (Write-Ahead Log)
enqueue()writes aTxRecord(status:pending) to localStoragesendTransaction()submits via Soroban RPCupdateRecord()saves tx hash and statussyncWithNetwork()checks all pending/unknown records viagetTransaction()PendingTxPanelat/pending-txshows the queue with Retry/Remove/Clear Completed controlsCloses #18