Repository navigation
test: add test suites for offline queue sync, concurrency, retry logic, and wallet integration - #1146
Open
Blackdavid1 wants to merge 1 commit into
Open
Blackdavid1 wants to merge 1 commit into
Blackdavid1 wants to merge 1 commit into
Conversation
… wallet integration (Stellar-split#1041, Stellar-split#1040, Stellar-split#1039, Stellar-split#1038) - Test offline queue synchronization with storage persistence, conflict resolution, and state recovery (Stellar-split#1041) - Test concurrent payment handling with nonce management, balance invariants, and race condition prevention (Stellar-split#1040) - Test transaction retry logic with backoff, jitter, network timeouts, 502/504 errors, and max retries (Stellar-split#1039) - Integration tests for Freighter, LOBSTR, xBull, Ledger, and WalletConnect adapters (Stellar-split#1038)
|
@Blackdavid1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
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.
What this fixes
This PR addresses four test and reliability issues:
What changed
Offline Queue Sync (Test offline queue synchronization #1041):
sync(strategy)onOfflineQueuewith conflict detection against remote invoice state and emittedqueue:conflict:resolvedevents.recoverState()to reconstruct queue from persistence storage.syncOfflineQueue()and offline event definitions onStellarSplitClient.test/offlineQueue.test.tswith 12 tests covering queue storage, sync process, conflict resolution, and state recovery.Concurrent Payment Handling (Test concurrent payment handling #1040):
test/concurrentPaymentHandling.test.ts(10 tests) validating simultaneous payments across multiple payers and invoices, sequential nonce assignment, balance conservation invariants, partial failure isolation, and race condition handling.Transaction Retry Logic (Test transaction retry logic #1039):
isRetryableinsrc/retryPolicy.ts.test/transactionRetry.test.ts(18 tests) verifying exponential backoff calculations, randomized jitter bounds, timeout / network error retries, max retry thresholds, unretryable error classification, and abort signal handling.Wallet Integration (Integration tests for all wallet types #1038):
StellarSplitClient.connectWallet()to seamlessly handle both browser extension wallets with.connect()/.onAccountChange()and standardWalletAdapterinstances using.getAddress().OptimisticCacheto prevent iteration crashes during wallet payments.test/walletIntegration.test.ts(19 tests) covering connection, signing, disconnection, account changes, and failure cases for Freighter, LOBSTR, xBull, Ledger, and WalletConnect.Testing
Ran all newly created and related test suites using Vitest:
test/offlineQueue.test.ts(12 passed)test/concurrentPaymentHandling.test.ts(10 passed)test/transactionRetry.test.ts(18 passed)test/walletIntegration.test.ts(19 passed)test/retryPolicy.test.ts(31 passed)test/optimisticCache.test.ts(12 passed)test/walletSessionManager.test.ts(26 passed)test/walletconnect.test.ts(14 passed)test/ledgerAdapter.test.ts(6 passed)test/freighterAdapter.test.ts(13 passed)test/xbullAdapter.test.ts(7 passed)Total: 11 test files, 168 tests passed, 0 failures.
Issues
closes #1041
closes #1040
closes #1039
closes #1038